Skip to content

List: Everything NimArray and Permutation

Everything Nim

This problem solution can be found in the test cases. We notice that if there exits one, we must choose one and others would decrease one. And this principle can be extends. So we consider the MEX and if it exits. And if is odd, Alice win, otherwise Bob win. And if MEX equals to the initial value, we can know that if is odd, Alice win.