Nim game winning position

Write codeMedium25 min

Your task

A pile has n stones. On each turn a player removes between 1 and m stones (inclusive). The player who takes the last stone WINS. Both play optimally and player one moves first. Return True if player one can force a win, else False. 0 <= n <= 10^9, 1 <= m <= 100. With n==0 there are no stones so player one cannot move and loses (return False).

Examples

bachet_first_wins(n: int, m: int) -> bool
Example 1
Inputbachet_first_wins(5, 3)
OutputTrue