Given an array of integers nums, return the index of the first element that appears exactly once in the array. If no such element exists, return -1. The input is a Python list of integers, and the output is a single integer index.
def first_unique_index(nums):