Find the first repeat characters in the given string and return the index.
Implement first_repeated_index(s) for a string s. Return the index of the first occurrence of the character whose second occurrence is encountered earliest while scanning left to right. Return -1 if every character is unique.
Function signature: def first_repeated_index(s): Input is a string, and output is an integer.
def first_repeated_index(s):