String Searching

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

You are given a 0-indexed string S with no more than 10^3 lowercase characters. Find the index of the first entire occurrence of a substring T, or output NOT THERE if T is not a substring of S.

Constraints

1 \le S, T \le 10^3

Input Specification

The first line contains the string S. The second line contains the string T.

Output Specification

The one and only line of output contains the index of the first entire occurrence of T in S, or NOT THERE if T is not present.

Sample Input

mycomputerisbetterthanyourshahaha
idisagree

Sample Output

NOT THERE

Comments

There are no comments at the moment.