Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Two Elements in an Array

med
30 min
Try to solve the Maximum Product of Two Elements in an Array problem.

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)imes(- 1) imes ( 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

med
30 min
Try to solve the Maximum Product of Two Elements in an Array problem.

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)imes(- 1) imes ( nums[j] −1)- 1).

Constraints:

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

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