Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Two Elements in an Array

Maximum Product of Two Elements in an Array asks you to choose two different positions in an integer array and return the largest product of their values after subtracting one from each.

Statement

Given an integer array nums, choose two different indices i and j from the array. Return the maximum possible value of ( nums[i] −1)×(- 1) \times ( nums[j] −1)- 1).

Constraints:

  • 2≤2 \leq nums.length ≤500\leq 500

  • 1≤1 \leq nums[i] ≤103\leq 10^3

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Two Elements in an Array

Maximum Product of Two Elements in an Array asks you to choose two different positions in an integer array and return the largest product of their values after subtracting one from each.

Statement

Given an integer array nums, choose two different indices i and j from the array. Return the maximum possible value of ( nums[i] −1)×(- 1) \times ( nums[j] −1)- 1).

Constraints:

  • 2≤2 \leq nums.length ≤500\leq 500

  • 1≤1 \leq nums[i] ≤103\leq 10^3