code: private boolean isInputBalanced() {
      Stack<Character> stack = new Stack<>();
      int length = input.length();
      for (int i = 0; i < length; i++) {
        char currentChar = input.charAt(i);
        if (currentChar == BRACE_START) {
          stack.push(currentChar);
        } else if (currentChar == BRACE_END) {
          if (stack.empty()) return false;
          if (stack.pop() != BRACE_START) return false;
        }
      }
      return stack.empty();
    }
docs: Checks whether input string is balanced Analyzes only curly braces like { and } and ignores
  other characters
  
  @return true if string is balanced