Problem list
Log in
#r03082 · Online Judge > GoldOJ

First Occurrence Index

Bronze II 2.0 s 1024 MB

Strings $S$ and $T$ are given (one per line). Print the 0-based index of the first occurrence of $T$ in $S$, or -1 if $T$ does not appear (Python str.find).

Input

Line 1: $S$ (length 1 to 100). Line 2: $T$ (length 1 to 10). Lowercase.

Output

Print the index of the first occurrence, or -1.

Example 1

Input
strawberry
raw
Output
2
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code