Sum of Two Integers - LeetCode 371 - Java

Sdílet
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

Komentáře • 10

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

    great video. amazing detail in the demonstration

  • @davidmwangi4312
    @davidmwangi4312 Před rokem +1

    Splendid explanation.

  • @fatlard3414
    @fatlard3414 Před 2 lety +1

    Super good explanation! Thanks for your help

  • @fjose8712
    @fjose8712 Před 6 dny

    Is it not simpler to use logarithms? Logarithms convert addtion to multiplication, so we don't need the + symbol...

  • @sethuprathapan4388
    @sethuprathapan4388 Před rokem

    there is a loop present , so how its become constant time complexity? can u please clarify my doubt?

    • @udaypandey5659
      @udaypandey5659 Před 7 měsíci

      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

  • @1murkeybadmayn
    @1murkeybadmayn Před 3 měsíci

    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.