Share your repls and programming experiences

← Back to all posts
5.5. Strings: First and last occurrence
pole55 (308)

"Given a string that may contain a letter f. Print the index of the first and last occurrence of f. If the letter f occurs only once, then output its index once. If the letter f does not occur, print -1."