Sir since all the piles have same number of coins therefore Grudey number will be same for all the piles. If there are even number of piles then xor will be 0 and 2 will win, otherwise 1 will win.
So, basically I am trying to check if n is odd or even.
Is there anything wring in this approach ?