Intersection of two sorted linked lists
You are given the heads of two singly linked lists, each sorted ascending with distinct values. Return a sorted list of the values that appear in both, using a single lockstep walk.
l1: 1 -> 2 -> 4 -> 8
l2: 2 -> 4 -> 6 -> 8
-> 2 -> 4 -> 8
Target time and extra space beyond the output.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.