Sir, I did not understand why you took j in dp[i][j] to be 0 as well in the first problem. I think j should be atleast 1 because how could you sell and buy at the same day. If j=1, then it would mean on day 0 he bought and on day 1 he sold But if j=0, then he did both buying and selling on the same day. Thanks.
Hey good question. In these questions, and in general in all dp questions, base cases are very important and sometimes slightly confusing. In this case, my localMax variable is initialised at INT_MIN, so that computation doesn't yield any other value than the default 0. Also, the fact that the question stated "atmost k transactions" instead of "exactly k transactions" makes a lot of things easier. Assuming items bought and sold on the same day gets counted as a harmless transaction. But feel free to use your own base cases that you feel more accurate, that should work as well.
Actually, many other youtubers have made videos on dp fundamentals, right? So, I'm trying to focus on those areas where you have lesser video coverage. I've thought of a playlist on educational DP stuff, but then that would probably mostly contain advanced stuff like DP+Bitmasking.
I am having upcoming interview at google. I am not feeling much confident especially in dp. Is it possible for me to connect with you.. I need some guidance
@@saptarshimukherjee3908Hi, I tried connecting with you, however, I am unable to message you. is there any other way to connect, asking since my interview is around the first week of april
Very helpful :)
Good Job! Wanted video on this topic since very long. Really appreciate such educational content 🙂🙂
Thanks a lot sir❤
awesome solution
Thanku so much bhaiya❤❤ i am enjoying your content. Please make more video on new topic. I am currently expert. I want to reach Master.
Darun video dada❤❤
Sir, I did not understand why you took j in dp[i][j] to be 0 as well in the first problem. I think j should be atleast 1 because how could you sell and buy at the same day. If j=1, then it would mean on day 0 he bought and on day 1 he sold But if j=0, then he did both buying and selling on the same day.
Thanks.
Hey good question. In these questions, and in general in all dp questions, base cases are very important and sometimes slightly confusing. In this case, my localMax variable is initialised at INT_MIN, so that computation doesn't yield any other value than the default 0. Also, the fact that the question stated "atmost k transactions" instead of "exactly k transactions" makes a lot of things easier. Assuming items bought and sold on the same day gets counted as a harmless transaction. But feel free to use your own base cases that you feel more accurate, that should work as well.
Dada why don't you make videos on dynamic programming?
Actually, many other youtubers have made videos on dp fundamentals, right? So, I'm trying to focus on those areas where you have lesser video coverage. I've thought of a playlist on educational DP stuff, but then that would probably mostly contain advanced stuff like DP+Bitmasking.
I am having upcoming interview at google. I am not feeling much confident especially in dp. Is it possible for me to connect with you.. I need some guidance
I have tried really hard, but still unable to find intuition in dp problems.. somehow getting stuck consist
@@rev_krakken70 we may connect on LinkedIn www.linkedin.com/in/saptarshi-mukherjee-52660616b?
@@saptarshimukherjee3908Hi, I tried connecting with you, however, I am unable to message you. is there any other way to connect, asking since my interview is around the first week of april
Bhaiya bhabhi ki Kasam Khao ki aisi video bnate rahoge 👀
Hahaha thanks dude, will try! 😅