Hello,
Can you please explain the technical details on how the original list is restored?
Thanks,
Kiran
When you reversed second half using
headSecondHalf = reverse(slow);
Now after the matching since you stored the headSecondHalf head in copyHeadSecondHalf
with reverse(copyHeadSecondHalf)
it will reverse back.