Single Number III - Leetcode 260 - Python

preview_player
Показать описание


0:00 - Read the problem
1:30 - Drawing Explanation
9:17 - Coding Explanation

leetcode 260

#neetcode #leetcode #python
Рекомендации по теме
Комментарии
Автор

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

aashishbathe
Автор

I don't like bit manipulation at all

AnordinaryMan
Автор

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

siddharth-gandhi
Автор

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.

tusov
Автор

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🎉

mahesh_bvn
Автор

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

yashwanthgajji
Автор

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

jayhee
Автор

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.

mrreese
Автор

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

ovokteb
Автор

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

MP-nyep
Автор

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

visintel
Автор

splendid logic (in depth know how of Bitwise Operations)

nipunshah
Автор

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

evalyly
Автор

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

adithyapaib
Автор

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

AMX
Автор

I would never have thought to use bit manipulation here

protodimbo
Автор

Bit Manipulation questions are haunting DCC!!!

dhaanaanjaay
Автор

I feel Navdeep = Srinivasa Ramanujan junior

gulshirulislam
Автор

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

LOKESHE-wiyd
Автор

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.

shazamx