Solution in C


  • 0
    S

    int findComplement(int num) {
    long int comp_num=1;
    while(comp_num<=num)
    comp_num<<=1;

    return (comp_num-1)^num;
    

    }


Log in to reply
 

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