You are viewing a single comment's thread. Return to all 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"; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
public static String counterGame(long n) { // Write your code here int count=0;
}