Null pointer exception

Sir/Mam
Am getting Null pointer exception in this code.
What should i do to resolve this issue:

Hello @Ekram,
You need to modify your approach a little. First find the number of elements in the loop say K. Then fix one pointer to head and another to K elements after head. Now find starting point of loop and find last element of loop. Delete this loop.

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.