Sorry! It’s fixed now.
@bansal1232 , Could you please explain logic that you used to decide that if N, M are even/odd, Chef/Yoda will be the winner. I tried to draw a 4 x 4, 4 x 5 grid, etc, to understand why, but couldn’t figure out what the logic was because there are so many moves possible.
Don’t start with 4x4 or 4x5!
Start with 1x1 and slowly proceed till 3x3. Try it once, and if its still unclear, I can help.
@vijju123, I made decision trees for tables of size 1x1, 1x2, 2x3, and 3x3. I can see that Yoda wins every time M and N are odd if we are playing with rule set 1 and Chef wins every time either M or N is even. But I fail to understand why this can be generalized to higher dimensions/values of M and N. My question is, how can we be sure that just because it worked till M, N <= 3, it will work for M, N>3. And also, what I didnt understand was if there is some optimal strategy that is there. For example, if Chef makes such and such a move, Yoda must make a move that fulfills certain conditions??
I am glad it helped. :).
The basic proof that we can extend our base solutions is existence of at least one winning strategy for CHEF/YODA (which they can repeat everytime the board dimensions are favourable) for some pattern in dimensions.