PROBLEM LINKS
DIFFICULTY
EASY
EXPLANATION
You just simply need to check that string has the length 5, 1st and 4th symbols are in the range ‘a’…‘h’, 2nd and 5th are in the range ‘1’…‘8’, 3rd symbol is ‘-’. After that you need to check is this a correct knight move which is easy exercise. Also you should be careful with spaces. If you use C++ and start your program with something like this scanf(“%d\n”,&TST) then you get wrong answer because the first string in the test contains only spaces and using this command you simply skip it and the second one starts with one space followed by the correct string. Using this command you skip this first space and analyze the string as correct however it’s not.
SETTER’S SOLUTION
Can be found here.
TESTER’S SOLUTION
Can be found here.