Getting segmentation fault

I used the same code as in the video but I’m still not getting the output instead there’s segmentation fault. My code:

hi @mitrapranav0027_5d705c8b616e0add


I have corrected the code… its working fine now…

The code in the video is wrong as I’m also getting the same error. The last element of the list is not getting printed. How do I fix it?

ok nvm I figured it out from your code. Thanks for the help

1 Like

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.

Actually I have a doubt. Why didn’t we use temp!=head in the while loop condition. I tried it but it didn’t work. Can you tell me why?