Given two singly linked lists, head1 and head2, write a function to check if the sequence of elements in head1 appears as a contiguous subsegment within head2.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.