Kotlinlearncs.online LogoJava
Return to List

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
boolean onlyMatchingBraces(String characters) {
return false; // You may need to remove this starter code
}

Related Lessons

Stuck? You may find these lessons helpful: