Visa
1 DSA problems asked in Visa coding interviews
1 Easy
0 Medium
0 Hard
All Categories
All
1 problem
Math1
Divisor Game
Easy
Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number n on the chalkboard. On each player's turn, that player makes a move consisting of choosing any x with 0 < x < n and n % x == 0, then replacing the number n on the chalkboard with n - x. Also, if a player cannot make a move, they lose the game. Return true if and only if Alice wins the game, assuming both players play optimally.