10000 [Wildcard Matching] fix · Pull Request #49 · haoel/leetcode · GitHub
[go: up one dir, main page]

Skip to content

[Wildcard Matching] fix #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Feb 4, 2015
Merged

[Wildcard Matching] fix #49

merged 1 commit into from Feb 4, 2015

Conversation

ghost
Copy link
@ghost ghost commented Feb 4, 2015

Added one test case: isMatch("_aa", "_a")

Bug (on Line#39 of the original file): when '*' meets '*', '*' in the pattern is treated as a normal character. That will fail the test mentioned above.

bool star = false;
const char *s1, *p1;
while( *s && (*p || star) ){
if (*p=='?' || *s == *p){
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buggy. * is treated as normal character when it meets *.

Added one test case: isMatch("*aa", "*a")
@haoel haoel merged commit c472178 into haoel:master Feb 4, 2015
haoel added a commit that referenced this pull request Feb 4, 2015
@haoel
Copy link
Owner
haoel commented Feb 4, 2015

Thanks @jakwings !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0