Divisor Game Problem

Divisor Game Problem — ExecCode Easy DSA Practice

Solve the Divisor Game problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Divisor Game. Your task is to compute the required answer and return true if and only if Alice wins the game, assuming both players play optimally. 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 integer x with 0 < x < n and n % x == 0.

Examples

Input {"n": 2}; Output True. Input {"n": 3}; Output False

Constraints

1 <= n <= 1000

Practice Divisor Game free on ExecCode. Browse DSA problems, topic map, and placement guides.