RithwikG's picture
initial commit
7a8878c
raw
history blame contribute delete
854 Bytes
One day, Zimpha casually came up with a problem. As a member of "Zimpha fan club", you decided to solve that problem.You are given two strings $$$s$$$ and $$$t$$$ of length $$$n$$$ and $$$m$$$, respectively. Both strings only consist of lowercase English letters, - and *.You need to replace all occurrences of * and -, observing the following rules: For each -, you must replace it with any lowercase English letter. For each *, you must replace it with a string of any (possibly, zero) length which only consists of lowercase English letters. Note that you can replace two different instances of - with different characters. You can also replace each two different instances of * with different strings.Suppose $$$s$$$ and $$$t$$$ have been transformed into $$$s'$$$ and $$$t'$$$. Now you're wondering if there's a replacement that makes $$$s'=t'$$$.