input: Write a Python function that, given an integer array `nums`, an integer array `queries`, and an integer `x`, identifies the index of the `queries[i]`_th occurrence of `x` in the `nums` array for each element in `queries`. If there are fewer than `queries[i]` occurrences of `x`, return -1 for that query.
  
  The function should return a list of integers containing the results for each query.
  
  Example:
  >>> nums = [1,3,1,7], queries = [1,3,2,4], x = 1
  [0,-1,2,-1]
  >>> nums = [1,2,3], queries = [10], x = 5
  [-1]
  
  Constraints:
  1 <= nums.length, queries.length <= 10^5
  1 <= queries[i] <= 10^5
  1 <= nums[i], x <= 10^4
output: def find_occurrences(nums, queries, x):
      results = []
      occ_indices = [i for i, num in enumerate(nums) if num == x]
      for query in queries:
          if query <= len(occ_indices):
              results.append(occ_indices[query - 1])
          else:
              results.append(-1)
      return results