private static int go(Map<String, Set<String>> map, String root, Map<String, Integer> values) {
        if (!map.containsKey(root))
            return 0;
        if (map.get(root).size() == 0)
            return values.get(root);
        int sum = values.get(root);
        Map<Integer, Integer> counts = new HashMap<>();
        Map<Integer, String> kk = new HashMap<>();
        for (String s : map.get(root)) {
            int r = go(map, s, values);
            kk.put(r, s);
            counts.put(r, counts.getOrDefault(r, 0) + 1);
            sum += r;
        }
        if (counts.size() == 1)
            return sum;
        int one = 1;
        int more = 1;
        for (Integer key : counts.keySet()) {
            if (counts.get(key) == 1) {
                one = key;
            } else {
                more = key;
            }
        }
        if (res == -1)
            res = values.get(kk.get(one)) - (one - more);
        return sum;
    }
Why Did you create this class? what does it do?
src/adventofcode/RecursiveCircus.java