My approach was to reverse the linked list and check each node in the original and reversed code.
However, it gives segmentation fault
Here is the link to my code:
Segmentation fault in the code
Hey @prerna_gupta31
this approach wont work ,linked list is nodes with connection when u reverse it then that means u break the previous connections and make new ones . So reverse LL and original LL are still same, u havent crated a new LL .
So logic for this is
Find mid pt
break and reverse 2nd half
Match both 1st half and 2nd half.
(Make sure u take care of LL with odd length
Alright… I’ll implement the code for this approach
Can you please help me find the error
