LeetCode Find Pivot Index Solution Explained - Java

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • The Best Place To Learn Anything Coding Related - bit.ly/3MFZLIZ
    Preparing For Your Coding Interviews? Use These Resources
    --------------------
    (My Course) Data Structures & Algorithms for Coding Interviews - thedailybyte.dev/courses/nick
    AlgoCademy - algocademy.com/?referral=nick...
    Daily Coding Interview Questions - bit.ly/3xw1Sqz
    10% Off Of The Best Web Hosting! - hostinger.com/nickwhite
    Follow My Twitter - / nicholaswwhite
    Follow My Instagram - / nickwwhite
    Other Social Media
    ----------------------------------------------
    Discord - / discord
    Twitch - / nickwhitettv
    TikTok - / nickwhitetiktok
    LinkedIn - / nicholas-w-white
    Show Support
    ------------------------------------------------------------------------------
    Patreon - / nick_white
    PayPal - paypal.me/nickwwhite?locale.x...
    Become A Member - / @nickwhite
    #coding #programming #softwareengineering
  • Věda a technologie

Komentáře • 24

  • @sakshamkumarmishra
    @sakshamkumarmishra Před 2 lety +4

    This logic also works fine
    int sum=0;
    for(int i=0;i

  • @Rizz_trader
    @Rizz_trader Před 7 měsíci +1

    that line " iam the king of mistakes"🤣🤣🤣🤣

  • @hussainyunus2045
    @hussainyunus2045 Před rokem +1

    Love the fact that it was actually a long explanation cause you did a great job at teaching the example at hand.

  • @RohitKumar-vb7gt
    @RohitKumar-vb7gt Před 4 lety +13

    if anyone listen you carefully ,then easily understand...really very good explanation...
    bro try to upload more video(leetcode) as much as possible...

  • @charismatic1516
    @charismatic1516 Před 4 lety +8

    Nice explanation! However, in the code, shouldn't line 10 be nums [i - 1] instead of nums [i]? Prefix sum is sum of all elem to left of current elem (at i). That is also the reason we check for i != 0, since there is nothing to left of 0, so we cannot do nums [0 - 1] and so we assume prefix sum = 0 in that case.

    • @DeGoya
      @DeGoya Před 2 lety

      depends on the requirements and constraints. Here it considers everything left from nums[0] as 0, as well as everything right from nums[nums.length - 1]

  • @nandiniverma5273
    @nandiniverma5273 Před 6 měsíci

    No dude , no mess at all thanks if the video is still longer bt you conveyed it nicely to people.

  • @ishaila2079
    @ishaila2079 Před 2 lety

    Thanks dude, you explained very well

  • @nandiniverma5273
    @nandiniverma5273 Před 6 měsíci

    You are amazing leetcoder nick.

  • @raginibhayana8305
    @raginibhayana8305 Před 2 lety

    Thank you so much and for also showing your mistakes, it helps us understand better

  • @tamimshams7676
    @tamimshams7676 Před rokem

    Yo Man - You are doing great and one of the best leetCoder

  • @kavyabanka4482
    @kavyabanka4482 Před rokem

    I love your way of teaching Nick Love from India💙

  • @nihardabhi5622
    @nihardabhi5622 Před 2 lety

    6:56 we respect your efforts !! love you bro !! we respect you

  • @RahulSoni-br1qd
    @RahulSoni-br1qd Před rokem +1

    it's more like a stand up dude ! 😂
    but worth it

  • @truptiraut6753
    @truptiraut6753 Před 4 lety +2

    You are the best leetcoder ever...your solutions are amazing with really good explanation!

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

    I never make mistakes, which is why watch your videos.... Just kiddin' great explanation. Thanks.

  • @nihardabhi5622
    @nihardabhi5622 Před 2 lety

    you are my ideal person !!!

  • @dincerbeken5761
    @dincerbeken5761 Před 2 lety

    Your explanations are the best and I love you bruh (much better than neetcode), but coming directly to the total sum may be not so intuitive, was not for me. I first solved it with left to right and right to left loops.
    Then to remove the extra space, I came up with the total sum.

  • @lifeofme3172
    @lifeofme3172 Před rokem +2

    I wasted 3 hrs in this problem. Trying to solve this

  • @srijitdebsarma3451
    @srijitdebsarma3451 Před rokem

    You are the best😍😌

  • @guptashashwat
    @guptashashwat Před 2 lety

    thnx,

  • @ashishthakur9983
    @ashishthakur9983 Před rokem

    🔥🔥🔥

  • @someshsaharan5813
    @someshsaharan5813 Před rokem

    04:10 my boy is high for sure lmao

  • @jawonwinbush
    @jawonwinbush Před rokem

    Luke Skywalker