Pattern searching
Easy Accuracy: 64.42% Submissions: 2445 Points: 2

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

Input Format: The input line contains T, denoting the number of testcases. Each testcase contains two lines. First line contains string str. Second line contains patter text.

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

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

1 <= T <= 100
1 <= |str| <= 30
1 <= |text| <= 30

Sample Input:

Sample Output:
Not present


We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.

Pattern searching

Output Window