8266: ABC279 —— B - LOOKUP
[Creator : ]
Description
You are given strings S and T consisting of lowercase English letters. Determine whether T is a (contiguous) substring of S.
A string Y is said to be a (contiguous) substring of X if and only if Y can be obtained by performing the operation below on X zero or more times.
A string Y is said to be a (contiguous) substring of X if and only if Y can be obtained by performing the operation below on X zero or more times.
-
Do one of the following.
- Delete the first character in X.
- Delete the last character in X.
Input
The input is given from Standard Input in the following format:
$S$
$T$
$S$
$T$
Output
If T is a (contiguous) substring of S, print Yes; otherwise, print No.
Constraints
S and T consist of lowercase English letters.
1≤∣S∣,∣T∣≤100 (∣X∣ denotes the length of a string X.)
1≤∣S∣,∣T∣≤100 (∣X∣ denotes the length of a string X.)
Sample 1 Input
voltage
tag
Sample 1 Output
Yes
tag is a (contiguous) substring of voltage.
Sample 2 Input
atcoder
ace
Sample 2 Output
No
ace is not a (contiguous) substring of atcoder.
Sample 3 Input
gorilla
gorillagorillagorilla
Sample 3 Output
No
toyotasystems
toyotasystems
Yes
It is possible that S=T.