private static int solve(List<Integer> list) {
        int count = 0;
        Set<String> set = new HashSet<>();
        String s = list.toString();
        System.out.println(s);
        while (set.add(s)) {
            int max = -1;
            int maxi = -1;
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i) > max) {
                    max = list.get(i);
                    maxi = i;
                }
            }
            list.set(maxi, 0);
            maxi++;
            maxi %= list.size();
            while (max > 0) {
                list.set(maxi, list.get(maxi) + 1);
                maxi++;
                maxi %= list.size();
                max--;
            }
            count++;
            s = list.toString();
            System.out.println(s);

        }

        return count;
    }
Why Did you create this class? what does it do?
src/adventofcode/MemoryReallocation_6.java