Will a pattern like '*' be considered as a valid pattern.


  • 0
    M

    To me such a pattern would mean, a string with an infinite number of same or different characters.


  • 3
    S

    I don't think so. The problem description says that * matches zero or more of the preceding element, which implies that * must have a preceding element that is not *, which is not the case here.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.