Arrays & Linked Lists

Answer & solution
Official answer: 5
Approach: Notice that the tested node is ptr1’s successor, not ptr1 itself. On deletion the pointer stays still, so the replacement successor is tested next.
Initially ptr1 points to the head value 1. Its successor 7 is not in L2, so advance to 7. The next value 12 is in L2, so bypass it, leaving 7 pointing to 3. Keep ptr1 at 7, test 3, and then advance to 3 because it is absent from L2.
Delete successor 9, retain and advance to 5, then delete 11 and 15 in consecutive iterations while ptr1 remains at 5. Finally retain 8 and stop because its next pointer is NULL.
The resulting list is 1→7→3→5→8, so five nodes remain. Although head value 1 also occurs in L2, it is never tested as a successor and is not removed. Advancing ptr1 after a deletion would incorrectly skip a candidate such as 15. The code unlinks nodes without calling free; the question asks reachability in L1, not the count of still-allocated memory objects.