Maximum Product of Two Elements in an Array Problem

Maximum Product of Two Elements in an Array Problem — ExecCode Easy DSA Practice

Solve the Maximum Product of Two Elements in an Array problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Description Given the array of integers nums, you will choose two different indices i and j of that array. Return the maximum value of (nums[i]-1)(nums[j]-1). Examples Example 1 Input: nums = [3,4,5,2] Output: 12 Explanation: If you choose the indices i=1 and j=2 (indexed from 0…

Practice Maximum Product of Two Elements in an Array free on ExecCode. Browse more ExecCode DSA problems.