← Questions

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

0
UberCodingLast asked Feb 2026

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.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding