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
|
1613 Discussions
|
Please Login in order to post a comment
My C code 😁😎
My Python submission gives RuntimeError or WrongAnswer in most of the test cases. Anyone knows why?
Stack st = new Stack<>(); for(int i=0;i0) return "NO"; else return "YES";
php solution
private static Boolean cMatch(Character l, Character c){ return ( l == '(' && c == ')') || ( l == '[' && c == ']') || ( l == '{' && c == '}'); } public static String isBalanced(String s) { // Write your code here Stack stack = new Stack<>(); stack.push('#');