BETA

Difficulty Level:

Easy

Total Submissions: 494 Accuracy:

19.03%

Wildcard string matching
     

Given two strings where first string may contain wild card characters and second string is a normal string. Write a function that returns true if the two strings match. The following are allowed wild card characters in first string.

* --> Matches with 0 or more instances of any character 
      or set of characters.
? --> Matches with any one character.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains two strings, a string with wildcard and one without.

Output:
Print "Yes" (without quotes) if the two strings match else print "No" (without quotes).

Constraints:
1<=T<=10^5
1<=length of the two string<=10^5

Example:
Input:

2
ge*ks
geeks
ge?ks*
geeksforgeeks

Output:
Yes
Yes

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Ayush Govil

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.