firstlastobs function

Locate the index of the first/last unique value