Karthik's submission of Buddy NIM | CodeChef