Given a string str and another string patt. Find the character in patt that is present at the minimum index in str. If no character of patt is present in str then print ‘No character present’.
The first line of input contains an integer T denoting the number of test cases. Then the description of T test cases follow. Each test case contains two strings str and patt respectively.
Output the character in patt that is present at the minimum index in str. Print "$" (without quotes) if no character of patt is present in str.
1 <= T <= 105
1 <= |str|, |patt| <= 105
Testcase 1: e is the character which is present in given patt "geeksforgeeks" and is first found in str "set".
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.