Best Time to Buy and Sell Stock II

Given daily stock prices, return the maximum profit you can achieve with as many buy/sell transactions as you like (but you must sell before you buy again).

Examples
Input: [7,1,5,3,6,4]
Output: 7
Hints

Best Time to Buy and Sell Stock II

Given daily stock prices, return the maximum profit you can achieve with as many buy/sell transactions as you like (but you must sell before you buy again).