You are given two strings 'S' and 'P' consisting of lowercase English alphabets. Your task is to find whether the 'P' is present in 'S' as a substring or not.
Note1. There may be more than one occurrence of 'P' in 'S'.
2. Some alphabets in the strings may be repeated.
1 <= T <= 100
1 <= |S| <= 10000
1 <= |P| < |S|
Where |S| and |P| represents the length of the string 'S' and 'P' respectively.
Time limit: 1 sec.
3
xxy yxxyxxy
a baac
cfg cgfgfc
YES
YES
NO
In the first test case, there are two substrings equal to P on index 1 and 4 in S.
In the second test case, there are two substrings equal to P on indexes 1 and 2 in S.
In the third test case, P does not exist in S.
3
bbb abba
iqw hdhhdqoa
car caribbean
NO
NO
YES
In the first test case, P does not exist in S.
In the second test case, P does not exist in S.
In the third test case, there is one substring equal to P on index 1 in S.