Skip to content

Files

Latest commit

 

History

History

Pattern searching - GFG

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Pattern searching

Easy

Given a string str and a pattern pat. You need to check whether the pattern is present or not in the given string. 

Example 1:-

Input:

2
abcdefh
bcd
axzy
xy

Output:
Present
Not present


Input Format: The input line contains T, denoting the number of test cases. Each test case contains two lines. First line contains string str. Second line contains pattern text.

Output format: For each test case in a new line you have to print the "Present" if found otherwise "Not present".

Your task: You need to complete the function searchPattern() containing string and text as an argument. You don't have to worry about input. 

Constraints:
1 <= T <= 100
1 <= |str| <= 100
1 <= |text| <= 100