Incorta interview question

Nim Game (Math Problem ) on LeetCode