Tap here to switch tabs
Problem
Submissions

Problem: Maximize Expression of Three Elements

med
30 min
Try to solve the Maximize Expression of Three Elements problem.

Statement

Given an integer array nums, select three distinct elements a, b, and c from the array to maximize the value of a+b−ca + b - c.

Return the maximum value obtainable from the expression.

Constraints:

  • 3≤3 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximize Expression of Three Elements

med
30 min
Try to solve the Maximize Expression of Three Elements problem.

Statement

Given an integer array nums, select three distinct elements a, b, and c from the array to maximize the value of a+b−ca + b - c.

Return the maximum value obtainable from the expression.

Constraints:

  • 3≤3 \leq nums.length ≤100\leq 100

  • −100≤-100 \leq nums[i] ≤100\leq 100