summary refs log tree commit diff stats
path: root/day10.py
diff options
context:
space:
mode:
authorBrian Chu <brianmchu42@gmail.com>2021-12-30 15:11:21 -0800
committerBrian Chu <brianmchu42@gmail.com>2021-12-30 15:11:21 -0800
commite7085453864431ace3ad8f3123b259ed0829ae74 (patch)
tree2ef1fbb0e9d02fc934b5e09d96dd187f3e371ea6 /day10.py
downloadAdventOfCode2015-main.tar.gz
all solutions for 2015 main
Diffstat (limited to 'day10.py')
-rw-r--r--day10.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/day10.py b/day10.py
new file mode 100644
index 0000000..c135c81
--- /dev/null
+++ b/day10.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+from itertools import groupby
+
+digits = "1113122113"
+
+for i in range(50):
+    digits = ''.join(str(len(list(g))) + str(k) for k, g in groupby(digits))
+    if i == 39:
+        print(len(digits))
+
+print(len(digits))
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141