#3745

Maximize Expression of Three Elements

newbie · 270 · lc easy +19 · 72.4% accepted · 52 likes · top 82%

Description

Given an integer array nums, pick three elements a, b, and c at distinct indices to maximize the expression a + b - c and return that maximum value.

Code

1
2
3