You are given an array prices where prices[i] is the price on day i. You may complete as many transactions as you like (buy one and sell one share multiple times). Return the maximum profit.
Constraints
1 <= prices.length <= 3 * 10â´
Examples
Input:prices = [7,1,5,3,6,4]
Output:7
Buy at 1, sell at 5 (profit 4). Buy at 3, sell at 6 (profit 3). Total = 7.