There is a problem here, what do you guys think?
Test case: [10, 11, 1, 10]
The answer is (1110) + (101) = 10
But I think the fact should be:

[10] > buy
number of stocks = 1
remainder = 0 
[11] > sell
number of stocks = 0
remainder = 11 
[1] > buy
number of stocks = 11
remainder = 0 
[10] > sell
number of stocks = 0
remainder = 110
so the result should be: 110  10 = 100
Give me some suggestions, Thanks!