It is said that ' * ' Matches zero or more of the preceding element. In this way, "a*" could be "aa" or nothing. But how can "a*" match "a"?
I believe that the statement ' "a*" could be "aa" or nothing' is incorrect. 'a*' can also be 'a'
In the problem, it says: '*' Matches zero or more of the preceding element.
Since the preceding element is 'a', * can represent nothing, 'a', 'aa', 'aaa', or any number of 'a's
That means that you can start with nothing, and add 'a's until we have the right number of 'a's.
Sorry I accidentally misread something earlier.
I hope this clarifies things!
@teddochi thanks! You help me a lot!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.