Why is my 33ms solution working?


  • 0
    J

    int rangeBitwiseAnd(int m, int n) {
    int result=n;
    if(n-m<=64){
    for(int i=n-1;i>=m;i--){
    result=result&i;
    }
    }else{
    return 0;
    }
    return result;
    }


Log in to reply
 

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