I think my solution to z-knight is good, I've tested it with my samples and it works, but when I submit it, it fails on 7 and 9 test cases with wrong answer. I can't get it... why isn't it working? If somebody knows what I'm doing wrong please tell me.
My code:
My code:
removed by moderator