atcoder#ABC276A. [ABC276A] Rightmost
[ABC276A] Rightmost
Score : points
Problem Statement
You are given a string consisting of lowercase English letters.
If a
appears in , print the last index at which it appears; otherwise, print . (The index starts at .)
Constraints
- is a string of length between and (inclusive) consisting of lowercase English letters.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
abcdaxayz
7
a
appears three times in . The last occurrence is at index , so you should print .
bcbbbz
-1
a
does not appear in , so you should print .
aaaaa
5