static public String countOfAtoms(String formula) {
        if (formula == null || formula.length() == 0)
            return "";
        StringBuilder builder = new StringBuilder(formula).reverse();
        Map<String, Integer> map = new HashMap<>();
        Stack<Integer> stack = new Stack<>();
        String elem = "";
        int sum = 1;
        for (int i = 0; i < builder.length(); i++) {
            char c = builder.charAt(i);
            if (Character.isDigit(c)) {
                int j = i;
                while (j < builder.length() && Character.isDigit(builder.charAt(j)))
                    j++;
                if (j != i) {
                    stack.add(Integer.parseInt(builder.substring(i, j)));
                    sum *= stack.peek();
                    j = i = 1;
                }
            } else if (c == '(') {

            }

        }
        return map.keySet().stream().sorted().map(s -> s + map.get(s)).collect(Collectors.joining());
    }
Why Did you create this class? what does it do?
src/problems/hard/NumberOfAtoms.java