← Back to topics
Topic

z-knight problem

Martin
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:

removed by moderator
dejandenib
The checker for this task is bad. The checkers are ussualy made to ignore newlines and spaces at end of line, but apparently this checker isn't like that. Probably you are printing one empty space at the end of the line which causes the answer to be incorrect.
Hint: the first string you output will be ("string") and all the others you'll print like this (emptyspace,"string"). This should fix your problem
Martin
Thanks a million, I can't believe I didn't figure this out. It was so simple :)