Exception in Thread error

Two issue:
1.
problem faced by same written code in ide is not taking last line of string input in IDE
Link: https://ide.codingblocks.com/s/185300

  1. Same code when i am trying to run in challenges portal “Exception in thread error” is appearing .

Kindly, help me with it . Thanks :slight_smile:

@Mayank2096,
Correct code: https://ide.codingblocks.com/s/185302

For the first error, use next instead of nextLine.
I am not getting a second error, your approach was incorrect. You need to use a recursive approach as your approach will overwrite wrong chars

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.