NoSuchElementException is an error typically caused by the Scanner class. It shows up consistently on some activities, inconsistently on others-- there's really no way to tell until you see it.
This isn't your fault. As far as I can tell, it happens when the Grader.java doesn't correctly send the test input to your code. However, there are some annoyingly esoteric ways to fix it.
Try/Catch
try & catch tell Java to ignore specific errors. It's not good coding practice to use this too much, but for this problem, there's not much else you can do.
Scanner Checking Methods
The Scanner class includes some methods for when you can't be sure about the user's input. This is better practice, but doesn't work on CodeHS sometimes.
Combining Solutions
If you're still having the error or your code isn't working the way it's supposed to, try combining both solutions. This is a bit overkill, but it shows your teacher that you know both the proper solution and the practical one!