You are viewing a single comment's thread. Return to all comments →
JAVA solution
public static String counterGame(long n) { int who=1; while(n!=1){ long step=1; while(step<n){ step*=2; } if(step==n){ n=n/2; }else{ n=n-(step/2); } who+=1; } return who%2==0?"Louise":"Richard"; }
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 →
JAVA solution