Magic Cows | Dynamic Programming | Adhoc | Interview problem

Sdílet
Vložit
  • čas přidán 11. 09. 2024

Komentáře • 50

  • @ialpha6431
    @ialpha6431 Před 4 lety +32

    Great one ! I guess this channel is the next Khan Academy.

  • @markkaravan4245
    @markkaravan4245 Před 4 lety +17

    This may be the best programming series I've seen online and I've seen a lot. Amazing work, William!

  • @itsahandle
    @itsahandle Před 4 lety +15

    This channel is so underrated man, I hope more people notice your hard work and learn something from u, thanks for the video keep it up!!

  • @mzmzgreen
    @mzmzgreen Před 4 lety +10

    I love this! More dp please! :)
    Also minimax is a topic that isn't so popular in tutorials.
    You're a great teacher, keep up the good work!

  • @abhishek.rathore
    @abhishek.rathore Před 3 lety +3

    Cowtosis: The process common in cows which leads to there duplication overnight. Usually caused by overeating of fresh grass.

  • @perseus1511
    @perseus1511 Před 4 lety +1

    Hi ,thank you so much williamFiset ,with you I learn what in university teachers never gonna teach me. Greetings from Peru and thanks for the subtitles.

  • @thallium54
    @thallium54 Před 4 lety +3

    Wow I didn't realized it could be solved using dynamic programming during the contest. That's such an elegant approach! Here I would like to describe my approach which may be a bit easier to think about:
    The key observation is that once an original farm is full for the first time, the number of farms needed to hold all the cows would double everyday. Knowing this we could calculate the answer without tracking the number of cows.
    The time complexity is O(NM), so either of these two approach may be faster under different constrains.

  • @treyi1794
    @treyi1794 Před 3 lety +5

    Hey, I absolutely love your content!! can you please please do an exclusive course on dynamic programming- the theory, problem-solving methods and frequently asked interview problems.

  • @sikandarbakht2076
    @sikandarbakht2076 Před 4 lety +14

    Please make a series of dp from scratch..... Thanks

  • @adityamishra4458
    @adityamishra4458 Před 4 lety +11

    please make competitive programming series

  • @pulgupta
    @pulgupta Před 4 lety

    Thanks William, you have a very nice way of explaining things. Your animations are great at conveying the idea before looking into code

  • @kmchary1181
    @kmchary1181 Před 2 lety

    The absolute best series.

  • @sograb
    @sograb Před 3 lety +1

    I was trying to find some tutorial about DP. Udemy and Pluralsight has such videos but despite they're not free, they're not as good as your videos. These visual explanations are so great. Thanks a lot! Could we support you anyhow?

  • @puneetkumarsingh1484
    @puneetkumarsingh1484 Před 4 lety +1

    An interesting variation of this problem will be like: Whenever the number of cows increases the maximum capacity, he creates a new farm for the extra cows with everything else remaining the same. It is like he is trying to maximize his efficiency of farm.

  • @alirezakamyab851
    @alirezakamyab851 Před 2 lety

    Nice channel, keep the dynamic programming coming

  • @shashanktiwari4442
    @shashanktiwari4442 Před 4 lety

    Awesome pls make a complete series including codeforces problems also will help a lot

  • @bhawnabharti4369
    @bhawnabharti4369 Před 3 lety

    Great contents on your channel. I am big fan of your teaching style. please add some more dp problems. It is very very helpful for strugglers

  • @prasannathapa1024
    @prasannathapa1024 Před rokem +1

    Some other approaches as well
    #include
    using namespace std;
    #define loop(i,x,n) for(int i = x; i < n; ++i)
    #define inp(f,n) loop(i,0,n){cin>>f[i];}
    int main() {
    int c,n,m;
    cin>>c>>n>>m;
    int f[n], q[m];
    inp(f,n);
    inp(q,m);
    loop(j,0,m){
    long long ans = 0;
    loop(i,0,n)
    ans += (1LL

  • @madhukiranattivilli2321
    @madhukiranattivilli2321 Před 3 lety +1

    If total number of farms with

  • @uXXair
    @uXXair Před 4 lety +1

    I don't get it. How are we supposed to derive such solutions? Is it just practice, practice, and practice?

  • @algorithmscasts902
    @algorithmscasts902 Před 4 lety

    Excellent explanation, thank you.

  • @benzhang8916
    @benzhang8916 Před 3 lety +1

    Hi are you going to illustrate some questions on LeetCode

  • @ialpha6431
    @ialpha6431 Před 4 lety +1

    Hi William, Could it be possible for you to add a new playlist explaining some of the good stuff from computational geometry ?

  • @runnerup15
    @runnerup15 Před 4 lety

    given the problem statement i dont even really know where to begin without watching the whole video. i think im learning this out of order maybe there must be something else i need to know before jumping into questions like this

  • @AK-vx4dy
    @AK-vx4dy Před 5 měsíci

    Maybe i'm wrong, but i think we don't need dp table to all days, but only 2 rows, if we will store the number of farms in query table and reuse rows ?

  • @oisindavey2340
    @oisindavey2340 Před 3 lety

    Great video! I think that this can also be solved using fast matrix exponentiation in O(Q•logD•log^3C).

  • @srini2010srini
    @srini2010srini Před 3 lety

    Cool explanation. Thanks.

  • @chenjason2598
    @chenjason2598 Před rokem

    Awesome!

  • @RedionXhepa
    @RedionXhepa Před 4 lety

    Nice work !

  • @astrallee7460
    @astrallee7460 Před 3 lety +1

    thanks !! really!!

  • @manngondaliya4704
    @manngondaliya4704 Před 4 lety

    Good work man 👍👍👍👍

  • @Red___Beast
    @Red___Beast Před 5 měsíci

    amazing

  • @bluejay9269
    @bluejay9269 Před 4 lety

    hey William, I noticed the problem vault website is down. What happened? I enjoyed using it for practice.

    • @WilliamFiset-videos
      @WilliamFiset-videos  Před 4 lety

      Problem vault was recently turned down because of the cost of renewing the domain was going to cost an outrageous amount, and we haven't yet bothered to find a new place to host it.

    • @puneetkumarsingh1484
      @puneetkumarsingh1484 Před 4 lety

      @@WilliamFiset-videos What is Problem Vault?

  • @subee128
    @subee128 Před 4 měsíci

    thanks

  • @prabhavrajeev9682
    @prabhavrajeev9682 Před 4 lety

    Please make a video on manachers algorithm

  • @adhishmalviya2408
    @adhishmalviya2408 Před 4 lety +1

    Videos are in 4K

  • @priyanka.sarkar
    @priyanka.sarkar Před 3 lety +1

    Hi William, your videos are just amazing. I had one question, I tried submitting the solution in the website but I did not get all the TCs correct. Link to the submission : open.kattis.com/submissions/6501122

  • @ragingpahadi
    @ragingpahadi Před 4 lety +1

    Cowmitosis 😁😁😁

  • @parthsaraswat9744
    @parthsaraswat9744 Před 2 lety

    i like this intro song

  • @lovesegtree
    @lovesegtree Před rokem

    your sound is small
    can you speak louder?

  • @andreamengoli4656
    @andreamengoli4656 Před 3 lety +1

    Cow Mitosis ahahha

  • @SC1240
    @SC1240 Před 3 lety

    this shit rules

  • @aa-xn5hc
    @aa-xn5hc Před 3 lety

    I dislike Kitties very much because it has got a very outdated version of C#