34 bytes JavaScript Solution


  • 0
    T
    getSum=g=(a,b)=>a?g((a&b)*2,a^b):b
    

    maybe shortest in all solutions. ^_^

    Use <<1 to replace *2 need 1 more byte (35 bytes) if you dislike * in the program.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.