Exception Error

I have imported Scanner class and i am getting “n” as input from user but while running the code ;it’s giving an error.

share the link of your code

The error is resolved.
Actually I never checked for the test case input.
Now it’s resolved.