Coding Interview Problem - Gas Station

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 72

  • @draigun3503
    @draigun3503 4 ปีที่แล้ว +21

    The way you first show the brute force and then optimise it is really helpful to understand the whole process.. everyone should give a moment to appreciate your work.. love from INDIA..

  • @mello.maniac
    @mello.maniac 2 ปีที่แล้ว

    I have looked at many solutions to this problem. No one ever explained why this solution works.
    This is the first time I actually understood why it works. This video is just gold.

  • @AbrarSher
    @AbrarSher 4 ปีที่แล้ว +17

    Great vid! I was wondering why the view count and subscriber count was so low considering this is an amazing explanation for this problem, esp considering some of the other ones, but then I noticed it's a recent vid and channel. Subbed, keep up the good work. It's nice being an early sub to a channel that uk will get big in no time

  • @jingrrrl5765
    @jingrrrl5765 2 ปีที่แล้ว +1

    The best explanation I've watched. Very complete reasoning process, answers all my questions

  • @shraytyagi7846
    @shraytyagi7846 4 ปีที่แล้ว +1

    What a great explanation man. Appreciate a lot. Your subscribers count and your teaching ability dont match. Keep making videos.

  • @amritanshusharma4767
    @amritanshusharma4767 3 ปีที่แล้ว

    Best solution of this problem so far

  • @MsUltraKawaii
    @MsUltraKawaii 4 ปีที่แล้ว

    Had to watch the improved algorithm explanation multiple times but now I finally understand! Great video, thanks!

  • @funjustinsun
    @funjustinsun 3 ปีที่แล้ว

    That is THE BEST explanation I ever get for this question. Thank you!

  • @navidr2811
    @navidr2811 3 ปีที่แล้ว

    The best explanation yet for this problem! thanks

  • @MagicalCreationAviCreation
    @MagicalCreationAviCreation 4 ปีที่แล้ว

    Great Great Great.......................explanation
    thank u sir ................
    Beginners like me need this kind of more videos...............

  • @sahanasekharpc3250
    @sahanasekharpc3250 4 ปีที่แล้ว +2

    This is just really amazing! The video description helps a lot. Thank you and keep making more!

  • @rahulshetty9335
    @rahulshetty9335 3 ปีที่แล้ว

    Gr8 Explaination!!! Please continue this series!!!

  • @potinmak1875
    @potinmak1875 3 ปีที่แล้ว

    Thanks for the detailed explanation here! Please make more videos like this!!!!

  • @jz-nz6tq
    @jz-nz6tq 4 ปีที่แล้ว +1

    this is the best explanation for this problem!

  • @akshatsrivastava9015
    @akshatsrivastava9015 3 ปีที่แล้ว

    This is the best explanation for this problem!! Keep up the good work! : )

  • @Socrates225
    @Socrates225 3 ปีที่แล้ว

    man you are fricking amaInggg, cleared all doubts

  • @kickradar3348
    @kickradar3348 3 ปีที่แล้ว

    Thanks for the explanation!

  • @alankrit3
    @alankrit3 2 ปีที่แล้ว

    amazing explanation, you solved every doubt that i had about this solution and i was convinced about the solution at the end. Thanks

  • @bhaveshkumar6842
    @bhaveshkumar6842 3 ปีที่แล้ว

    Great explanation!

  • @vinaykumardahiya4260
    @vinaykumardahiya4260 2 ปีที่แล้ว

    What a beautiful explanation!

  • @hamsalekhavenkatesh3440
    @hamsalekhavenkatesh3440 3 ปีที่แล้ว

    shldn't u do start = (i + 1) % gallons.size() ? to avoid crossing the array boundaries ?

  • @arnabganguly4962
    @arnabganguly4962 3 ปีที่แล้ว

    Beautiful.What's your website or github details you mentioned for the code.

  • @getsetgoscience7386
    @getsetgoscience7386 4 ปีที่แล้ว +1

    great explaination..and animation makes its easy to grab.

  • @aanandroy5434
    @aanandroy5434 3 ปีที่แล้ว

    Just amazing! You explained it beautifully!

  • @flyingcanopy5611
    @flyingcanopy5611 3 ปีที่แล้ว

    I dont know why this video has only 11 k views.. Should have been atleast 10^5 views .

  • @ajaykotian5
    @ajaykotian5 3 ปีที่แล้ว

    You are awesome! Your videos are top-notch.

  • @tsasa192
    @tsasa192 2 ปีที่แล้ว

    This is a very expensive coding challenge considering current gas prices

  • @joseignacioochoa264
    @joseignacioochoa264 3 ปีที่แล้ว

    awesome content!!!!

  • @allan1827
    @allan1827 3 ปีที่แล้ว

    Keep doing ...this.....ur good in this.

  • @testpark5647
    @testpark5647 3 ปีที่แล้ว

    Excellent

  • @melvinkimathi8924
    @melvinkimathi8924 3 ปีที่แล้ว

    you got yourself a new subscriber ! Your explain is great

  • @suhag04
    @suhag04 4 ปีที่แล้ว

    Great explanation of the problem.

  • @functionaldevs8381
    @functionaldevs8381 3 ปีที่แล้ว

    Big Thank you !! I finally understand why the algo works, phew !!

  • @ahanmr7547
    @ahanmr7547 4 ปีที่แล้ว

    Hey! Did you go ahead and launch this website, I'd love to see more content, it's truly amazing, where can I find more content?

    • @KnapsackLabs
      @KnapsackLabs  4 ปีที่แล้ว

      Hi, sorry I'm really busy with interviewing myself actually and thus the delays. I am to hoping to deploy the site early to mid November. Thanks for watching my content and I'm glad you found it useful!

  • @samsang8971
    @samsang8971 3 ปีที่แล้ว

    Great videos and explanations!

  • @Animelover-ds9vg
    @Animelover-ds9vg 3 ปีที่แล้ว

    Nice work bro, thanks

  • @PremPal-uy4nm
    @PremPal-uy4nm ปีที่แล้ว

    Thank You! Thank You! Thank You! I can finally die in peace.

  • @ashwanikumar4288
    @ashwanikumar4288 3 ปีที่แล้ว

    Thank you very much!! Great explanation!

  • @ArjunSingh-of6vm
    @ArjunSingh-of6vm 3 ปีที่แล้ว

    great explanation, you earned a subscriber.

  • @sanjeev0075
    @sanjeev0075 3 ปีที่แล้ว

    Pure Gold !!!

  • @divyabhimanadula786
    @divyabhimanadula786 3 ปีที่แล้ว

    Sir can you once check this for the input gas : [2,3,4,5] and cost : [2,1,4,3] I am getting answer as index 0 but I need to get 2 index as output

  • @shubhamthind8286
    @shubhamthind8286 4 ปีที่แล้ว

    Beautiful explanation. Subbed!

  • @HpDopeman
    @HpDopeman 3 ปีที่แล้ว

    Can we sort the indexes based on (Gas[i] - Cost[i]) ? Will this work ?

  • @arnabchakraborty246
    @arnabchakraborty246 3 ปีที่แล้ว

    Thank you very much

  • @nandwalritik
    @nandwalritik 4 ปีที่แล้ว

    Great Explanation

  • @hashtagcc
    @hashtagcc ปีที่แล้ว

    Ur videos are awesome pls post more videos

  • @talivanov93
    @talivanov93 4 ปีที่แล้ว

    Great explanation! Thank you

  • @wbq7311
    @wbq7311 3 ปีที่แล้ว

    In your last example (9min51sec), let's label the gas station [0, 1, 2, 3, 4, 5, 6, 7], if you find the starting point to be 5, how do you make sure the car can make its way back from 0 to 5?

  • @Igloo11
    @Igloo11 4 ปีที่แล้ว +1

    Thanks a lot!!!

  • @architshinde3977
    @architshinde3977 3 ปีที่แล้ว

    Very helpful!

  • @Satu0King
    @Satu0King 4 ปีที่แล้ว

    Amazing explanation

  • @neo9530
    @neo9530 ปีที่แล้ว

    Thank you! Finally I can die in peace.

  • @asishraz6173
    @asishraz6173 4 ปีที่แล้ว

    Great explanation brother. Clicked me in one time only. Wow, nice. It took me hours to figure out and then I got to see your video and it just helped me in less than 10 minutes. Thank you for sharing this. Keep up the great work.

    • @KnapsackLabs
      @KnapsackLabs  4 ปีที่แล้ว

      Thank you! Glad the explanation helped!

  • @tehepicduck101
    @tehepicduck101 4 ปีที่แล้ว

    good explanation

  • @dhruvamin197
    @dhruvamin197 3 ปีที่แล้ว

    I saw many videos on this problem, but none of them are as simple as this one

  • @sunginjung3854
    @sunginjung3854 4 ปีที่แล้ว

    Thank you for the great video. I really love your explanations. Is there any chance you could do snakes and ladders from leetcode?

    • @KnapsackLabs
      @KnapsackLabs  4 ปีที่แล้ว

      I have a few other videos planned right now, but I'll definitely take a look at it and make a video about it in the future!

    • @sunginjung3854
      @sunginjung3854 4 ปีที่แล้ว

      @@KnapsackLabs thanks!!

  • @bismeetsingh352
    @bismeetsingh352 4 ปีที่แล้ว +1

    Can you explain the optimal solution a little better?

  • @meht8
    @meht8 4 ปีที่แล้ว

    Awesome

  • @robert3258
    @robert3258 3 ปีที่แล้ว

    thanks!

  • @subhambanerjee6334
    @subhambanerjee6334 4 ปีที่แล้ว

    such a nice video

  • @balaeinstein8710
    @balaeinstein8710 4 ปีที่แล้ว

    bro , a small suggestion from my side. why can't change the name of the channel. "cracking coding interview problems" , "Algorithms and ideas for interview prep " . These are few suggestions. The appropriate name might attract the enthusiastic learners. This channel should be know for all preparing for coding interviews.

    • @KnapsackLabs
      @KnapsackLabs  4 ปีที่แล้ว +1

      Hello, thank you for the suggestion, I will certainly take it into consideration!

    • @mathguy198
      @mathguy198 3 ปีที่แล้ว

      But this name sounds quite cool, knapsack is an inseparable part of any ds algo enthusiast😉, so I guess everyone can relate this name with the contents of this channel

  • @ayaramzy6815
    @ayaramzy6815 3 ปีที่แล้ว

    excellent explanation but you speak tooo fast

  • @arnabganguly4962
    @arnabganguly4962 4 ปีที่แล้ว

    Beauty