@@ -0,0 +1,1448 @@
+package aoc21;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Scanner;%0A%0Apublic class Day8 %7B%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in).useDelimiter(%22%5Cn%22);%0A        List%3CEntry%3E entries = new ArrayList%3C%3E();%0A        while (in.hasNextLine()) %7B%0A            entries.add(new Entry(in.nextLine()));%0A        %7D%0A        long count = entries.stream().map(Entry::countUniqueDigits).reduce(0L, Long::sum);%0A        System.out.println(count);%0A%0A    %7D%0A%0A    private static class Entry %7B%0A        private String part1;%0A        private List%3CString%3E part2;%0A%0A        public Entry(String line) %7B%0A            Scanner scanner = new Scanner(line).useDelimiter(%22 %5C%5C%7C %22);%0A            this.part1 = scanner.next();%0A            Scanner part2Scanner = new Scanner(scanner.next());%0A            part2 = new ArrayList%3C%3E();%0A            while (part2Scanner.hasNext()) %7B%0A                part2.add(part2Scanner.next());%0A            %7D%0A        %7D%0A%0A        @Override%0A        public String toString() %7B%0A            return %22Entry%7B%22 +%0A                    %22part1='%22 + part1 + '%5C'' +%0A                    %22, part2='%22 + part2 + '%5C'' +%0A                    '%7D';%0A        %7D%0A%0A        public long countUniqueDigits() %7B%0A            return part2.stream().filter(s -%3E %7B%0A                int length = s.length();%0A                return (length == 2) %7C%7C (length == 4) %7C%7C (length == 7) %7C%7C (length == 3);%0A            %7D).count();%0A        %7D%0A    %7D%0A%7D%0A

add day 8 part 1