Leetcode 1464: Maximum product of two elements in an array
1 min readJun 12, 2020
In this Leetcode problem, we are asked to compute the maximum product of 2 elements in the array, knowing that the elements are positive.
Solution
- According to the constraints, all numbers are positive ( >0 )
- Therefore the problem is equivalent to finding the 2 highest numbers in the array
(a, b)
, and return…