Statment is as follow Given a number of piles in which each pile contains some numbers of stones/coins. In each turn, a player can choose only one pile and remove any number of stones (at least one) from that pile. The player who cannot move is considered to lose the game (i.e., one who take the last stone is the winner).
We can find solution by Xoring all the values of piles. But we have constraint In each turn, a player can choose only one pile and remove any number of stones between 1 to H
. How to solve this modified one ?
From my point of view it will remain unchanged.. We have to calculated the xor values only.