We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Balanced Brackets
Balanced Brackets
Sort by
recency
|
1630 Discussions
|
Please Login in order to post a comment
Fairly simple Stack based problem. Nothing too complex.
Here's my Java 8 solution, passing all test cases, for Max Score of 25:
C++: its run correctly in my compiler but when i run it on hackerrank it shows me that all test cases are wrong, and i try all of the test cases and it run correct on my compiler, i dont know what to do!!
C++:
string isBalanced(string s) { std::map m {{'(',')'}, {'{','}'}, {'[',']'}}; std::stack st;
}
Simple java solution in O(n) 100%: