public static boolean isBalanced(String brackets) {
        if (brackets == null || brackets.isEmpty()) {
            return true;
        }
        if (brackets.contains("()")) {
            return isBalanced(brackets.replaceFirst("\\(\\)", ""));
        }
        if (brackets.contains("[]")) {
            return isBalanced(brackets.replaceFirst("\\[\\]", ""));
        }
        if (brackets.contains("{}")) {
            return isBalanced(brackets.replaceFirst("\\{\\}", ""));
        }
        return false;
    }