• + 0 comments

    public static String counterGame(long n) { // Write your code here int count=0;

        while(n!=1){
    
        if(((n)&(n-1))==0){
            n=n>>1;
        }
    
    
        else{
            n=n-Long.highestOneBit(n);
    
        }
    
         count++;
    
    }
    if(count%2==0){
        return "Richard";
    }
    return "Louise";
    
    }
    

    }