Greedy Algorithms - Best Time to Buy and Sell Stock II
Given the following code implementing the peak-valley approach, what is the output for prices = [7,1,5,3,6,4]?
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions