Question expectation unclear


#1

I understood that if I have a stock I can sell one of it on day i, then on any day j (j>i) , I can buy one stock, then sell it on a day k and so on… ex: 1 50 1 50 49, then ans is 49, not 98

What is meant here is that, you can buy exactly once, and then sell exactly once, throughout the days.
So in total, you can buy once and sell once, that is it. Hope someone benefits from this comment, also interviewbit please make the problem statement clearer.


#2

Thanks man, it helped me a lot in understanding the question.
I agree, I’ve also encountered a lot of questions on interviewbit where the question is unclear and the examples are not explained. Hope they improve upon this.