Single Number - Leetcode 136

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


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

Wow! that's a really cool way to solve this problem..

albin_joby
Автор

I am feeling like XOR is some kind of a super sauce

manthanmoudgalya
Автор

This is legitimately so cool. Using your understanding of how code works in assembly to make a cool more efficient solution to a problem

MichaelPiraino
Автор

Did this problem a few days ago...understood the XOR approach now
Thanks man! ♥️

shreyansh_
Автор

Thanks for that. I struggle with bit manipulation type problems.

EMdragonKnight
Автор

Dude these shorts are sp extremely good make me wanna leetcode regularly 😊

lightwoodalec
Автор

Also, XOR is commutative, so the order the numbers appear doesn't matter at all

hola-hola-
Автор

this is sooo specific lol there is no way a person will think you came up with that during the interview lol

JP-jfoc
Автор

I would just used a stack and solved it similar to parenthesis matching

cman
Автор

We can use the index of and the last index to check if it's a chat array in Java.

KarthikMohanaKrishnan
Автор

Wow and i thought i was creative with xors. Beautiful application of a fundamental.

Wont lie i scoffed at the east label. But what a fantastic example.

josephvictory
Автор

if explain more how the position arent affect the result would be even better

allenytw
Автор

this only works because the XOR operator and the set of all binary numbers satisfy

del
Автор

Take a isseen boolean array of size n+1 by default all values are falsw.
Now traverse the array of each number if the array value is seen already then add it to the result array

geetasarayaarts
Автор

Nice but this would be a lousy interview question

life_score
Автор

What program is it, that analyze the code and shows memory and ms results?

marcindj
Автор

There's no way a normal person would think this solution in a coding interview. You straight up memorize it or you're cooked. 💀

perenegro
Автор

Does any knows how can i learn all these niche tricks?

ggwp
Автор

Would you be able to use a Set data structure instead? And just return the first element?

outofboundsbro
Автор

Whats that app you use to get the time perf ?

mehdim