0 ms one line java solution


  • 4
    L
    public class Solution {
           public int getSum(int a, int b) {
                 return (b == 0)? a : getSum(a ^ b, (a & b) << 1);
         }}

Log in to reply
 

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