Circular linked list

why it is showing run time error in some of the test cases .please have a look to my code

Hello @harshitgrover12,

Run-time error is for the test cases like:

  1. 1 2 3 4 5 5 -1
  2. 1 2 3 4 5 1 2 -1

Let me know if you still face any issue.
Hope, this would help.