Array
2091. Removing Minimum and Maximum From Array
Only two elements matter here: the minimum and the maximum. Everything you delete comes off one of the two ends, so once you know where those two values sit, the cost is fully determined and you just pick the cheapest way to reach both from the edges.
Loading…