Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Three Elements After One Replacement

Maximum Product of Three Elements After One Replacement asks you to choose three distinct array elements and maximize their product after replacing at most one value with any permitted integer.

Statement

You are given an integer array nums.

You may perform at most 11 operation where you choose an element in nums and replace it with any integer in the range [−105,105][-10^5, 10^5].

Return the maximum possible product of 33 elements chosen from distinct indices in nums after performing at most 11 replacement.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • −105≤-10^5 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Product of Three Elements After One Replacement

Maximum Product of Three Elements After One Replacement asks you to choose three distinct array elements and maximize their product after replacing at most one value with any permitted integer.

Statement

You are given an integer array nums.

You may perform at most 11 operation where you choose an element in nums and replace it with any integer in the range [−105,105][-10^5, 10^5].

Return the maximum possible product of 33 elements chosen from distinct indices in nums after performing at most 11 replacement.

Constraints:

  • 3≤3 \leq nums.length ≤105\leq 10^5

  • −105≤-10^5 \leq nums[i] ≤105\leq 10^5