DP + Prefix Tricks | Buy and Sell Stocks IV | LC Hard Problem | Codeforces Round 932 Problem C

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 17

  • @sunnymaurya205
    @sunnymaurya205 6 місяців тому +1

    Very helpful :)

  • @sravikumar3165
    @sravikumar3165 6 місяців тому +2

    Good Job! Wanted video on this topic since very long. Really appreciate such educational content 🙂🙂

  • @xd-qq3cu
    @xd-qq3cu 6 місяців тому +2

    Thanks a lot sir❤

  • @jaskarankamboj750
    @jaskarankamboj750 6 місяців тому +1

    awesome solution

  • @004vishal3
    @004vishal3 6 місяців тому +1

    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.

  • @Algorithmswithsubham
    @Algorithmswithsubham 6 місяців тому +1

    Darun video dada❤❤

  • @kshitij7791
    @kshitij7791 6 місяців тому +1

    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.

    • @saptarshimukherjee3908
      @saptarshimukherjee3908  6 місяців тому

      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.

  • @adityaghosh6170
    @adityaghosh6170 6 місяців тому +1

    Dada why don't you make videos on dynamic programming?

    • @saptarshimukherjee3908
      @saptarshimukherjee3908  6 місяців тому +4

      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.

  • @rev_krakken70
    @rev_krakken70 6 місяців тому +1

    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

    • @rev_krakken70
      @rev_krakken70 6 місяців тому

      I have tried really hard, but still unable to find intuition in dp problems.. somehow getting stuck consist

    • @saptarshimukherjee3908
      @saptarshimukherjee3908  6 місяців тому

      @@rev_krakken70 we may connect on LinkedIn www.linkedin.com/in/saptarshi-mukherjee-52660616b?

    • @rev_krakken70
      @rev_krakken70 6 місяців тому

      @@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

  • @AryanAryan-ks5ib
    @AryanAryan-ks5ib 6 місяців тому +2

    Bhaiya bhabhi ki Kasam Khao ki aisi video bnate rahoge 👀