My understanding * >> [one copy preceding element] OR [ empty, 0,escape of preceding element]
. >> any thing
In this case, the "aaa" contains no b, so the * before b and c must be [ 0, empty]. So,
isMatch( "aaa", "abaca") =isMatch( "aaa", "aaa") .
Now isMatch( "aaa", "aa*a") = isMatch( "aaa", "aa") OR isMatch( "aaa", "aaaa") .
In both condition above, the result is false.
Why the answer is true?
the expression can be written as a b* a* c* a If a letter has a star AFTER it, then it goes like this
a b* a* c* a
a 00 a 00 a
which returns true.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.