Pattern Searching (GFG)

Pattern Searching 

Given a text and a pattern. Find whether the pattern exist in the text or not. If it is present print "found" without quotes else print "not found"
without quotes.

Input:

The first line of input contains an integer T denoting the number of test cases. Each test case consist of a string in 'lowercase' only in a
separate line.

Output:

Print "found" or "not found" in a separate line.


Constraints:

1 ≤ T ≤ 30
1 ≤ |s| ≤ 100


Example:

Input
1
geeksforgeeks
geeks
Output
found


SOLUTION:

t=int(input())

for i in range (t):

    a=input()

    b=input()

    if b in a :

        print("found")

    else:

        print("not found")

Comments

Popular posts from this blog

Short Notes Of computer Network

Short Note of Data Structure

Sort in specific order (GFG)