@wz2326 What does this exactly mean? if we were given price = [1,2,3,4], then if we buy 1 share at day1, buy the 2nd share at day2, then sell 1 share at day3, and sell the other share at day4, totally get 4 profits, which conditions of the problem is violated? Or should the description " you may not engage in multiple transactions at the same time " be interpreted as the following: a complete transaction is defined as buy and sell (I reverse engineering to understand the definition for this problem), so this implies that if you want to buy a share, you must have sold the previous share. Hence, you can't buy at day1 and then buy another share at day2, as you have not sold your share bought on day1. Is my understanding correct?