diff --git a/d05.py b/d05.py new file mode 100755 index 0000000..7026c23 --- /dev/null +++ b/d05.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +from sys import argv + +b = [int(x.replace("F", "0").replace("B", "1").replace("L", "0").replace("R", "1"), 2) for x in open(argv[1])] + +ok2 = 0 +for x in range(min(b), max(b)+1): + if x not in b: + ok2 = x + break + +print(max(b)) +print(ok2) diff --git a/d05_input.txt b/d05_input.txt new file mode 100644 index 0000000..12abaf5 --- /dev/null +++ b/d05_input.txt @@ -0,0 +1,789 @@ +BFFFBBFRLR +FBFFFBBLRL +BFFFFFBRRR +FBBBFFFLRR +FFBFBFBRLL +FBBFFBBLRR +FBBFFFFRLL +BFFFBBFRLL +BBFBFBFRLL +BFFFFFBRLL +FFBFFFBRRR +BBFFBFFRLR +BBFFBBFLLL +FBFBFBFLLL +BBFFFFFLLR +FFBBBFFRLL +FFBFFBFRRR +BFFFBBFLRL +BFBBBBFLRR +BFBFFBFLLL +FFBFFBBLRL +FFBFBFFRLR +FFBFBBBLLR +FFFBBFBLLR +FFFBBBFLRL +FBFBBBFLLL +FBBFFFBLLR +BFFFBBBRLL +FFBBFBBRRL +FBFFBBBLLR +FBFBBFFRRL +FBBBBFFLLL +FFBFBFFLLR +BFFFFBFLLR +FBBBFBFLRR +FBFFFFFRRR +FFBFBBFRRL +BFFFBBBLLR +FBBFFBFRLL +BFFFFBBRLL +FBBBFFFRRL +BBFBFFFLLR +FBBFBBFRLR +FFFBFFBRRR +BFBBFBBLRL +FBBBFFBLRR +BBFFBBFLRR +FFBBFBBLLL +BFFBBBBRRL +FBBFBFBRLL +BFFFFFFRRL +BBFBFBFLLL +FBFFBFFLLR +FBFBFBFRLR +BFBFBBBRLR +BBFFBBFLLR +BFFBFBFRRR +BFBBFBFLLL +FBFBBFBRLR +FBBFBFBLRL +FBFFBFFLRR +BFFFFFFRRR +BFFFFBFRLL +FBFBFFFLLR +BFFFFBFLRL +BBFFFFFRLL +FBFBFFFLRR +BFFBF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BBBFFFRLL +BBFFBFBRRL +FBBBFBFRRR +FFBFBFFLLL +FBFFFFBRRR +BFBFFBBLLL +FFFBFBFRLL +FBBFBBFLLL +BBFFFBFRRL +FFFBBFBLLL +BBFBFBBRLL +BFBBBFBRRR +BFFFFBBLRR +BFBFFFBRLL +BFFFBFFLRR +BFFBBBFRLR +FBBFFFFRRR +FBFFBBBLRL +FFBBBFFLRR +FFBFBBBRRR +BFBBFFFRLL +BFBFBBBLLR +FFFBBFFRLL +FBFBFBFRLL +FBBBBFFRLL +FFFBBBFRLR +BFBFBBBLRR +FBFFBFFRRL +FFBFFBFRLL +FBBFFFBRRR +FBBFFBBRRL +BBFFFBFRRR +FFFBBBFRRL +FFFBBFFLLL +BFBBFBFRLR +FBBBBBFLLL +BFBFBFFLLL +FBFBFFFRRR +FBFFBFFRLR +BFBBFBBLRR +FFBBFFBRLL +BFBBFBBRLL +FBBBBBFRRL +BFFFBFBRLR +BFBBBBBLRL +BFFBFFBRRR +BBFBFBFRRL +BFBFFBFRLR +BFFBFFFLRR +FBBBBFBRLL +BBFBFFBRRR +BFFFBFBRRL +BFFBFBBRLR +FBBBBFBLRR +BFBFFBBRLR +BFBBBFBRLR +BBFFFBBRRL +FBBFBFFLLL +FFBFFFFRLR +FBFBFFBRLR +BFFFBFFRLL +FBFBBBFRRL +FBFBFFFLRL +BBFBFFFLRR +FFBFFFFRRR +BFBBBFBRRL +FFFBBBBLLL +BBFBFBBRRL +FFBFFBBLRR +FBBFFBFLLR diff --git a/d05_output.txt b/d05_output.txt new file mode 100644 index 0000000..c2074e1 --- /dev/null +++ b/d05_output.txt @@ -0,0 +1,2 @@ +864 +739