[6,1,3,2,4,7] the result should be:
(3-1) + (7-2) = 2+5 =7
But test result is 6
Only 1 transaction is allowed, my friend.
tricky, I also thought it meant one transaction a day and NOT one buy/sell in the entire period
Same misunderstanding here... Upvote this post to suggest admin change the description of the problem.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.