SUM


  • 0
    S

    we can get the all bit 1 by |,and we can get 1 at the same bit by & in two Integer.
    "'
    public class Solution {
    public int getSum(int a, int b) {
    return (a&b)+(a|b);
    }
    }
    "'


  • 0
    Z

    operator '+' is not permitted.


Log in to reply
 

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