Best Time to Buy and Sell Stock II

pricesArray
[7, 1, 5, 3, 6, 4]
1def maxProfit(prices):
2    maxProfit = 0
3
4    for i in range(1, len(prices)):
5        if prices[i] > prices[i - 1]:
6            maxProfit += prices[i] - prices[i - 1]
7
8    return maxProfit
0 / 12
715364