Can you write a function to reverse a linked list or find elements in an array?
Implement the array option. Given nums and targets, return one list of zero-based indices for each target, preserving target order. Use find_elements(nums, targets); return an empty list for a target with no matches.
def find_elements(nums, targets):