@@ -0,0 +1,979 @@
+package aoc20;%0A%0Aimport java.util.Scanner;%0A%0Apublic class Day5 %7B%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int maxSeen = 0;%0A        while (in.hasNextLine()) %7B%0A            String line = in.nextLine();%0A            if (line.isEmpty()) %7B%0A                break;%0A            %7D%0A            int id = getSeatId(line);%0A            maxSeen = Math.max(id, maxSeen);%0A        %7D%0A        System.out.println(maxSeen);%0A    %7D%0A%0A    private static int getSeatId(String line) %7B%0A        String rowSection = line.substring(0, 7);%0A        String rowSectionAsBin = rowSection.replaceAll(%22F%22, %220%22).replaceAll(%22B%22, %221%22);%0A        int rowNumber = Integer.parseInt(rowSectionAsBin, 2);%0A        String columnSection = line.substring(7, 10);%0A        String columnSectionAsBin = columnSection.replaceAll(%22R%22, %221%22).replaceAll(%22L%22, %220%22);%0A        int columnNumber = Integer.parseInt(columnSectionAsBin, 2);%0A        return (rowNumber * 8) + columnNumber;%0A    %7D%0A%7D%0A

day 5 1