Sum of Two Integers - LeetCode 371 - Java
Vložit
- čas přidán 23. 07. 2024
- In this video you will see a detailed explanation of LeetCode's Sum of Two Integers. Also, you will learn important bit manipulation techniques!
Video Contents:
00:00 - Read and understand the question
00:48 - Understand number bases (Base 10 and 2)
05:52 - Understand XOR/AND/Left Shift bitwise operators
09:10 - Explain the intuition/approach
14:40 - Solve a detailed example on the black board
18:19 - Code the solution
22:23 - Time and Space Complexity
great video. amazing detail in the demonstration
Thank you!
Splendid explanation.
Thank you very much!
Super good explanation! Thanks for your help
Thank you! Glad I helped you out!
Is it not simpler to use logarithms? Logarithms convert addtion to multiplication, so we don't need the + symbol...
there is a loop present , so how its become constant time complexity? can u please clarify my doubt?
because this loop will always do operation for 32 times. so here 32 is fixed , so if some thing is fixed we say it constant time
I would prefer you wrote the explanation while writing the code because you did not show what happens when there is a carry i.e. when it does not equal 0 in the previous explanation. The while loop condition says while carry is not 0 so now I am confused if the carry is a single digit. Edit: In fact, I found from chatgpt that 6 + 6 does have a carry but you reversed the operations so that confused me.