3745. Maximize Expression of Three Elements
You are given an integer array nums. Choose three elements a, b, and c from nums at distinct indices such that the value of the expression a + b - c is maximized. Return an integer denoting the maximum possible value of this expression. Example 1: Input: nums = [1,4,2,5] Output: 8 Explanation: We can choose a = 4, b = 5, and c = 1. The expression value is 4 + 5 - 1 = 8, which is the maxim
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start