Find Character Indices

Python function returning the first and last index of a specified character in a given word.

Often words are a mix of repeating and non-repeating characters. Tracking the positions of a character in a word is a basic task in string manipulation. The function `find_indices(word: str, char: str) -> List[int]` you need to develop, will accept a word and a character as inputs and yield a list with the first and last indices of that character in the word. If the character isn't found, the function must return `None`. ### Parameters - `word` (str): A non-empty string of lowercase letters representing a word. - `char` (str): A lowercase character. ### Return Value - Returns a list with the first and last index of the character in the word. If the character is not found, return None. ### Examples ```python # 'l' first appears at index 2 and last at 3 in 'hello' find_indices("hello", "l") # [2, 3] # 'c' first appears at index 0 and last at 8 in 'circumlocution' find_indices("circumlocution", "c") # [0, 8] # 'h' only appears at index 0 in 'happy' find_indices("happy", "h") # [0, 0] # 'e' does not appear in 'happy' find_indices("happy", "e") # None ```