EasyArray· 72% acceptance
#330

Best Time to Buy and Sell Stock 10

Easy

Return the maximum profit from one buy and one sell. Variant **#10**.

Example 1

Input: prices = [11,14,10,13,9,12]

Output: 3

Constraints

  • 1 <= prices.length <= 10^5

Acceptance: 72% · Topics: array, dynamic-programming

maxProfit

← All practice problems