Solve: Validate Brackets
Created By: Justin Maier
/ Version: 2024.12.0
Complete the method below that takes in a String containing only the enclosing characters '(', ')', '[', and ']'.
The function should determine whether the ordering and pairing of the brackets form a valid expression. For example,
- "[()]" is valid.
- "[()[]" is not valid since the first bracket '[' is not matched.
- "[(])" is not valid as the outer closing bracket ']' occurs before the inner closing bracket ')'.
For this problem we're expecting only a method.
Don't define a class, include modifiers like static or public, add import statements, or add code outside the method declaration.You may use the following packages for this problem without importing them: java.util.Stack
boolean validBrackets(String input) {
return false;
}