Single Number III - Leetcode 260 - Python

🚀 neetcode.io/ - A better way to prepare for Coding Interviews
🧑‍💼 LinkedIn: / navdeep-singh-3aaa14161
🐦 Twitter: / neetcode1
⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
Problem Link: leetcode.com/problems/single-...
0:00 - Read the problem
1:30 - Drawing Explanation
9:17 - Coding Explanation
leetcode 260
#neetcode #leetcode #python

Пікірлер: 49

  • @AnordinaryMan007
    @AnordinaryMan007Ай бұрын

    I don't like bit manipulation at all

  • @viveksoni3269

    @viveksoni3269

    Ай бұрын

    Bit manipulation is awful!

  • @reactionchamber

    @reactionchamber

    Ай бұрын

    same here

  • @brij4887

    @brij4887

    Ай бұрын

    Do you hate it more than dynamic programming? I can some what come close to a solution for bit manipulation problems but I can't understand dp solutions even after watching the explanation multiple times.

  • @AnordinaryMan007

    @AnordinaryMan007

    Ай бұрын

    @@brij4887 Na bro dp is much better than this.

  • @brij4887

    @brij4887

    Ай бұрын

    @@AnordinaryMan007 to be able to solve dp problems on my own do I need to solve enough problems in order to reach the moment where it all clicks? Do you have any suggestions?

  • @siddharth-gandhi
    @siddharth-gandhiАй бұрын

    these are interesting questions, however bit manipulation questions just feel like one trick pony solutions (much like greedy). interesting but not satisfying sadly.

  • @NeetCodeIO

    @NeetCodeIO

    Ай бұрын

    I agree, I don't think I've ever been asked bit manipulation in an interview. Has anyone here been asked it?

  • @PanicAtProduction

    @PanicAtProduction

    Ай бұрын

    Do you think blind-75 and neetcode-75 are still solid??

  • @venkadeshb7973

    @venkadeshb7973

    Ай бұрын

    @@NeetCodeIO Not in interviews but in most of the OA's

  • @samarth_suthar_

    @samarth_suthar_

    Ай бұрын

    @@NeetCodeIO i think that it is more relevant to embedded system role's interview(close to electronics role).

  • @ap2s2000

    @ap2s2000

    Ай бұрын

    @@NeetCodeIO I've had experience with Apple asking bit manip

  • @aashishbathe
    @aashishbatheАй бұрын

    You flipped the 3 and 5 in a and b.. But the concept is clear.. Thanks neetcode!

  • @NeetCodeIO

    @NeetCodeIO

    Ай бұрын

    Good catch, yeah thats my mistake. It would technically still work tho, so hopefully its not too confusing

  • @aashishbathe

    @aashishbathe

    Ай бұрын

    @@NeetCodeIO yess it still works. Awesome solution man. I can never think of such a solution ever 😂

  • @LotsOfFunyoutubechannel

    @LotsOfFunyoutubechannel

    Ай бұрын

    Had to rewind back multiple times but the grouping still didn't make sense. This comment cleared my doubt. Should have been the top comment😅

  • @csam11100
    @csam11100Ай бұрын

    The a-ha moment is the grouping concept. Feel depressed even practicing more than a thousand of LC, still can not get it in an hour and open YT to watch your solution like I did 4 years ago. (BTW, we can use xor & -xor to find the right most set bit of xor) Appreciate your explanation as usual.

  • @yashwanthgajji4036
    @yashwanthgajji4036Ай бұрын

    This is really a tricky one. Your explanation is so much better. Thank you so much. Finally, I got 'May' badge in leetcode.🎉

  • @user-wi3cy8hq3v
    @user-wi3cy8hq3vАй бұрын

    Your explanation is amazing. Thanks!

  • @mahesh_bvn
    @mahesh_bvnАй бұрын

    Hey Navdeep, first of all a huge thank you for making videos and helping us throughout the journey of DSA. I would like to request you to make LC bi weekly and weekly contest solutions as well. The questions in contests contain different gravy and it'll help us be more prepared for interviews... Cheers🎉

  • @guy_cod
    @guy_codАй бұрын

    Thank you very much neetcode ❤

  • @fraserdab
    @fraserdabАй бұрын

    Great explanation

  • @MP-ny3ep
    @MP-ny3epАй бұрын

    Tricky problem but your solution made it look very easy. Thank you

  • @jayhee1557
    @jayhee155729 күн бұрын

    This is the best explanation I was able to find. Thanks NeetCode.

  • @ovokteb9671
    @ovokteb9671Ай бұрын

    So much crystal clear explanation . Really in love with you ❤

  • @mrreese2342
    @mrreese2342Ай бұрын

    The concept is understandable but to come up with the solution is almost impossible, thank you for the explanation it's the clearest one on youtube.

  • @visintel
    @visintelАй бұрын

    Not gonna lie I don’t think I can come up with this solution in an interview

  • @chien-yuyeh9386
    @chien-yuyeh9386Ай бұрын

    Nice!

  • @jhanavikumari274
    @jhanavikumari274Ай бұрын

    wow i was looking for it

  • @nipunshah1373
    @nipunshah1373Ай бұрын

    splendid logic (in depth know how of Bitwise Operations)

  • @protodimbo
    @protodimboАй бұрын

    I would never have thought to use bit manipulation here

  • @AMX0013
    @AMX0013Ай бұрын

    I hope no one ever asks bot manipulation in an interview, and the only one who ever has to use it, be the compiler🙏

  • @evalyly9313
    @evalyly9313Ай бұрын

    I like your solution, even it makes me feel bad of myself because I will never come up with this myself 😢

  • @dhaanaanjaay
    @dhaanaanjaayАй бұрын

    Bit Manipulation questions are haunting DCC!!!

  • @rahulsihara8946
    @rahulsihara8946Ай бұрын

    That's quick mate 😂

  • @adithyapaib
    @adithyapaibАй бұрын

    class Solution: def singleNumber(self, nums: List[int]) -> List[int]: xor,a,b = 0,0,0 for i in nums: xor^=i diff = xor & -xor for i in nums: if diff & i: a^=i continue b^=i return [a,b] A better solluiions

  • @BrendanBennett-jj2rn
    @BrendanBennett-jj2rnАй бұрын

    what drawing software do you use?

  • @LOKESHE-wi2yd
    @LOKESHE-wi2ydАй бұрын

    bro we need 137 single number ii two bucket approach in your way of explanation please , i can't found your video for that problem

  • @gulshirulislam6936
    @gulshirulislam6936Ай бұрын

    I feel Navdeep = Srinivasa Ramanujan junior

  • @joelnoronha6031
    @joelnoronha6031Ай бұрын

    I have a Microsoft technical interview for a software engineer on 12th and 13th june. I started leetcode last week, any tips to clear the interview, since i would only have like 2 weeks of leetcode practice.

  • @qj3690
    @qj3690Ай бұрын

    can you solve path sum 3 please

  • @yaxprajapati115
    @yaxprajapati1156 күн бұрын

    just tell me from where have you learnt to build intuition?

  • @rishikkumarb7684
    @rishikkumarb7684Ай бұрын

    leetcode 2035 ,if possible can u able to make a video for this problem ?