You are given an array arr[] of non-negative integers, return the maximum product of two numbers possible.
Example 1
Input: arr[] = [1, 4, 3, 6, 7, 0]
Output: 42
Explanation: 6 and 7 have the maximum product.
Example 2
Input: arr[] = [1, 100, 42, 4, 23]
Output: 4200
Explanation: 42 and 100 have the maximum product.
Approach, complexity and clean code in every language. Sign in to unlock the editorial.
Your submissions, results and runtime history live here. Sign in to start your streak.
1 100 42 4 23
4200
1 4 3 6 7 0
42
2 4 7 5
35