Skip to content

Commit

Permalink
Update wildcard-matching.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 committed May 1, 2015
1 parent 24c6208 commit 8d93982
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Python/wildcard-matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def isMatch(self, s, p):
class Solution4:
# @return a boolean
def isMatch(self, s, p):
if not p:
return not s
if not p or not s:
return not s and not p

if p[0] != '*':
if not s or (p[0] == s[0] or p[0] == '?'):
Expand Down

0 comments on commit 8d93982

Please sign in to comment.