What concept of game theory is used to solve this problem?
I found total steps taken for each pair of numbers to become equal and then checked whether it was odd or even, however this method TLE’d.
Yes you need to use Sprague Grundy Theorem. My editorial had some errors and was not properly explained. I will post it in couple of hours time.
That’s ok, I’ve posted a Topcoder link that provides a sufficient explanation I think.