Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1115 |
@bt8816103042 | 739 |
@SherlockHolmes3 | 447 |
@codeantik | 441 |
@SHOAIBVIJAPURE | 430 |
@shalinibhataniya1097 | 408 |
@ShamaKhan1 | 392 |
@neverevergiveup | 381 |
@amrutakashikar2 | 355 |
@mahlawatep | 353 |
@murarry3625 | 352 |
Complete Leaderboard |
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
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes