I have seen many anwser of C++ but almost every answer was complex and difficult to understand.
I think i have solved it with the best approach possible using only a loop and two variables.
https://rajeshkathuriasblog.blogspot.com/2022/02/buy-and-sell-stocks-leetcode-c.html
Its ad free , it only feels good to get a few views
Thank you