Palindrome of a linked list

Output : Error

Exception in thread “main” java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:862)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Sc
the same code is excuting fine here https://ide.geeksforgeeks.org/10F1h2kSx9

There must be a problem with the input format. Can you please provide the question link. I can’t access it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.