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.
booleanonlyMatchingBraces(Stringcharacters) {
returnfalse; // You may need to remove this starter code