Skip to content
← Back to Community
5.5. Strings: First and last occurrence
Profile icon
pole55

"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."

Voters
Profile icon
AiriezHernandez
Profile icon
AthalyeGargee
Profile icon
rpurins
Profile icon
tomsfy
Profile icon
Yash24
Profile icon
phandung0310
Profile icon
a39093Joana
Profile icon
DavidPawelko
Profile icon
pole55