diff --git a/10/1.py b/10/1.py new file mode 100644 index 0000000..47c54ad --- /dev/null +++ b/10/1.py @@ -0,0 +1,12 @@ +with open("input") as f: + content = [int(x.strip()) for x in f] + +content.sort() +diffs = [] +for i in range(len(content) -1 ): + diffs.append(content[i+1] - content[i]) + +ones = diffs.count(1) + 1 +threes = diffs.count(3) + 1 + +print(ones * threes) diff --git a/10/einput b/10/einput new file mode 100644 index 0000000..ec4a03f --- /dev/null +++ b/10/einput @@ -0,0 +1,11 @@ +16 +10 +15 +5 +1 +11 +7 +19 +6 +12 +4 diff --git a/10/einput2 b/10/einput2 new file mode 100644 index 0000000..e6376dc --- /dev/null +++ b/10/einput2 @@ -0,0 +1,31 @@ +28 +33 +18 +42 +31 +14 +46 +20 +48 +47 +24 +23 +49 +45 +19 +38 +39 +11 +1 +32 +25 +35 +8 +17 +7 +9 +4 +2 +34 +10 +3 diff --git a/10/input b/10/input new file mode 100644 index 0000000..1ae22aa --- /dev/null +++ b/10/input @@ -0,0 +1,90 @@ +114 +51 +122 +26 +121 +90 +20 +113 +8 +138 +57 +44 +135 +76 +134 +15 +21 +119 +52 +118 +107 +99 +73 +72 +106 +41 +129 +83 +19 +66 +132 +56 +32 +79 +27 +115 +112 +58 +102 +64 +50 +2 +39 +3 +77 +85 +103 +140 +28 +133 +78 +34 +13 +61 +25 +35 +89 +40 +7 +24 +33 +96 +108 +71 +11 +128 +92 +111 +55 +80 +91 +31 +70 +101 +14 +18 +12 +4 +84 +125 +120 +100 +65 +86 +93 +67 +139 +1 +47 +38