public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        while (scanner.hasNext()) {
            try {
                int i = Integer.parseInt(scanner.next());
                list.add(i);
            } catch (Exception e) {
                break;
            }

        }
        System.out.println(solve2(list));
    }
Why Did you create this class? what does it do?
src/adventofcode/MemoryReallocation_6.java