Much clearer explanation then the solutions leetcode has written up, thank you!
@olegkovtun5011 Жыл бұрын
Thanks man, it is very instructive!
@tvsnath18 күн бұрын
Much clear explanation. thank you.
@nands44104 жыл бұрын
8:05 why do you take max? We want to buy the lowest price right
@saianishmalla26464 жыл бұрын
Yeah so you need to understand that the value is actually referring to the profit like you said we want the lowest price. When you buy your profit decreases which is why we choose the value where we lose less of our profit.
@ParthPatel-ji1up2 жыл бұрын
@@saianishmalla2646 @nands , i think a better word instead of profit there is balance. when we buy, our balance becomes less. which we want to buy with whatever that makes the balance the highest (decrease by the least).
@vaibhavagarwal90994 жыл бұрын
Wooow !!! I saw your channel for the first time today🥺 and your content is unbelievable 😍
@saianishmalla26464 жыл бұрын
Hahahaha thanks Vaibhav 😂😂
@mikasaackerman26943 жыл бұрын
Great Explanation! Would you also make a video of Buy and Sell Stock where the transactions are generalized to k?
@Greatasfather3 жыл бұрын
Hey what do you do for variable number of transactions
@jeneyify3 жыл бұрын
I have been following you as I have started leet coding. Amazing explanation, but how do we reach that level where we're able to think of such solution without any help
@parthpatel85322 жыл бұрын
You can reach that level by 2 ways. 1. Keep trying and trying until you get an answer. This is the bad way. You'll waste alot of time. 2. When you cant solve a problem in 2 days, come to youtube or something and search for the solution. Learn how the solution is created including patterns used. And in the future when a similar problem arises, you'll know how to solve it. The goal isnt to solve all by yourself. The goal is to learn the patterns and where to use each one!
@TheonlyKT12256 ай бұрын
Next level broo
@debashishmahato459111 ай бұрын
Beats 99.98% of users 🔥
@426116283 жыл бұрын
The part that I find a little hard to wrap my head around is we're doing two transactions in a single iteration, unless I work it out, I probably don't think that part is all that intuitive, not saying the solution is the problem, my understanding is the problem :)