Hi, regarding to problem IV, you mentioned
approach 2
For every stock, calculate cash in hand after buying and selling it in the two arrays. This is done in a loop j from 1 till k where j denotes the cash in hand after jth buy and sell.
so j is from 1 to k
but in code, j is from k to 1?
btw, your linkedln is locked and can't send message