So i wrote the code and ran it, and got the error saying "java.lang.NumberFormatException: Solution.java, method main, line: 18" and "Error converting a string to a number (invalid format)." Thats what you get i think when you enter letters instead of number (Even though i entered the digit, not letter) and try to parse it. And got stuck for half hour trying to figure whats wrong with the code, and then i just tried to verify it as it is, and it passed?!?!? If you can please check if something is wrong with the task.
This task has some errors or something, please check it