Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The game can be mapped to minmax game. Alice tries to maximize the total score and Bob tries to minimize it.
Use dynamic programming to simulate the game. If the total score was 0 the game is "Tie", and if it has positive value then "Alice" wins, otherwise "Bob" wins.