Best time to buy and sell stock: one trade, then two

0
Remix

Given a stock's daily prices, return the most profit you can make:

  1. With one buy and one later sell.
  2. With at most two non-overlapping trades.
UberCodingLast asked Feb 2026
No answer yet. Write the first one; the best answer gets endorsed.