Skip to content
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

Hi ValidParentheses.java #125

Open
richardkelly2014 opened this issue Jun 5, 2019 · 9 comments
Open

Hi ValidParentheses.java #125

richardkelly2014 opened this issue Jun 5, 2019 · 9 comments

Comments

@richardkelly2014
Copy link

else if(s.charAt(i) == ')' && !stack.isEmpty() && stack.peek() == ')') {
} else if(s.charAt(i) == ']' && !stack.isEmpty() && stack.peek() == ']') {
} else if(s.charAt(i) == '}' && !stack.isEmpty() && stack.peek() == '}') {}
this code is bug
repair:
else if (s.charAt(i) == ')' && !stack.isEmpty() && stack.peek() == '(') {
} else if (s.charAt(i) == ']' && !stack.isEmpty() && stack.peek() == '[') {
} else if (s.charAt(i) == '}' && !stack.isEmpty() && stack.peek() == '{') {}

@richardkelly2014
Copy link
Author

path : leetcode/string

@IAmPramod
Copy link

else if(s.charAt(i) == ')' && !stack.isEmpty() && stack.peek() == ')') {
} else if(s.charAt(i) == ']' && !stack.isEmpty() && stack.peek() == ']') {
} else if(s.charAt(i) == '}' && !stack.isEmpty() && stack.peek() == '}') {}
this code is bug
repair:
else if (s.charAt(i) == ')' && !stack.isEmpty() && stack.peek() == '(') {
} else if (s.charAt(i) == ']' && !stack.isEmpty() && stack.peek() == '[') {
} else if (s.charAt(i) == '}' && !stack.isEmpty() && stack.peek() == '{') {}

Please add complete code snippet

@joimxjtuse
Copy link

God, this bug has been around for more than a year.

@Abbas-Hussain-Muzammil
Copy link

Hey, Is this issue solved and assigned?

@Hoopeu
Copy link

Hoopeu commented Jan 25, 2022 via email

@Jiruiyang
Copy link

Jiruiyang commented Jan 25, 2022 via email

@lingbaoer
Copy link

lingbaoer commented Jan 25, 2022 via email

@JR00010
Copy link

JR00010 commented Jan 25, 2022 via email

YatharthBhargava added a commit to YatharthBhargava/interviews that referenced this issue Feb 13, 2022
@YatharthBhargava
Copy link

YatharthBhargava commented Feb 13, 2022

@richardkelly2014 can you please see this, #209 .

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

No branches or pull requests

9 participants