Wildcard Pattern Matching

medium
1. You are given two strings S1 and S2. S1 represents a text and S2 represents a wildcard pattern.
2. You have to print 'true' if the wildcard pattern is matched with the given text, otherwise print 'false'.

The wildcard pattern can include the characters '?' and '*'
'?' - matches any single character
'*' - matches any sequence of characters (including the empty sequence)

Input Format

2 strings S1 and S2

Output Format

Check the sample output and question video.

Constraints

1 < length of strings S1 and S2 <= 200

Example

Input
baaabab
ba*a?
Output
true
Previous
Print All Paths With Target Sum Subset
Next
Longest Repeating Subsequence

Related Questions