The second occurrence

The second occurrence. Given a string that may or may not contain the letter “f”, print the index location of the second occurrence of the letter “f”. If the string contains the letter “f” only once, print -1. If the string does not contain the letter “f”, print -2.

Test Case Input (String) Expected Output
1 find the function 11
2 coffee 3
3 alphabet -2
4 first -1