Solve: Only Matching Braces
Created By: Chris Taylor
/ Version: 2023.7.0
Complete the following recursive method that returns true
if and only if the string passed contains only matching braces.
- "{}" -> true
- "{{}}" -> true
- "{{0}}" -> false
- "{{{}}" -> false
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.boolean onlyMatchingBraces(String characters) {
return false;
}