Hi can someone explain the below testcase ? Thanks


#1

How is the o/p 1 for the below one ?

isMatch("aab", "c*a*b") → 1

#2

c * this means we can match with 0 or more c, here we will match with 0 c

So ‘c*’ equivalent to ’ ', ‘c’, ‘cc’, ‘ccc’, … etc. Here we will take ’ '.
Similarly ‘ca’ is equivalent to ’ ', ‘a’, ‘aa’, ‘aaa’, … etc. Here we will take ‘aa’.

And at last ‘b’ is already there so, it is also same. Therefore it matches.