You are viewing a single comment's thread. Return to all comments →
Assume both players always play optimally.
Java 7 solution below...
public static int towerBreakers(int n, int m) {
int winner = 0; if(n%2 == 1){ if(m > 1){ winner = 1; }else{ winner = 2; } }else{ winner = 2; } return winner; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Tower Breakers
You are viewing a single comment's thread. Return to all comments →
Assume both players always play optimally.
Java 7 solution below...
public static int towerBreakers(int n, int m) {
}