Please help me in "Puzzle Game" question


I have been trying to solve this practice problem H1,

Here is my code:

It gives me WA. But I verified my solution against a previously accepted solution. All I needed to do is to check if my dictionary ‘depths’ is matching with the corresponding dictionary in an accepted code. And they were matching!

Can somebody please help me figure out why I’m geting WA?

Thanks in advance!


Here is the list of depths file, I generated it using my solution and it’s accepted. You may compare and find if your program is working fine.