
Given the head of a singly linked list, where each node has an integer val and an integer timestamp. Implement a function filterNodes(head, targetTimestamp) that recursively traverses the linked list. The function should collect the val of all nodes whose timestamp is strictly greater than targetTimestamp. The collected vals must be returned as a list, maintaining their original order as they appear in the linked list.
Explanation: Nodes with timestamps 150 and 200 are strictly greater than 130. Their values (20 and 40) are collected in order.
Explanation: All node timestamps (50, 60, 70) are less than or equal to 80. No values are collected.
Access the full code editor, ThinkBuddy AI hints, and track your progress.