From quite a long time I was trying to solve this problem [problem:225D], but I am stuck on how to create a mask for this snake and how to extract information from the mask for doing further BFS.↵
↵
I referred to [user:I_love_Tanya_Romanova,2015-07-22]'s solution [submission:4086309] for the same, but was unable to understand the magic behind his mask.↵
↵
So can someone help me understanding how to create mask for this problem.↵
↵
Many others have used a hash function to solve this problem. I wonder how?↵
↵
↵
I referred to [user:I_love_Tanya_Romanova,2015-07-22]'s solution [submission:4086309] for the same, but was unable to understand the magic behind his mask.↵
↵
So can someone help me understanding how to create mask for this problem.↵
↵
Many others have used a hash function to solve this problem. I wonder how?↵
↵