Best Time to Buy and Sell Stock
CodingPhone Screen, OnsiteSoftware Engineer, Machine Learning EngineerReported Mar, 2026High Frequency
Examples
Example 1:
Input: prices = [10,1,5,6,7,1]
Output: 6
Explanation:
Example 2:
Input: prices = [10,8,7,5,2]
Output: 0
Explanation: