Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b737e0

Browse files
committed
Day 10 - golfing
1 parent 6b67984 commit 7b737e0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ As this is controversal in the code golfing community I reported the length of b
7373
```Python
7474
exec(bytes('㵦慬扭慤搠洬洺湩椨洫映牯椠椠慲杮⡥敬⡮⥤椩⁦敬⡮孤㩩⭩嵭㴩氽湥猨瑥搨楛椺洫⥝⤩搊漽数⡮椢⤢爮慥⡤਩牰湩⡴⡦Ɽ⤴昬搨ㄬ⤴
','u16')[2:])
7575
```
76-
- Day 10 - 224/137 chars
76+
- Day 10 - 218/134 chars
7777
```Python
7878
from itertools import*
79-
a,b=list(zip(*[[(i+1)*x*(i%40==19),"\n"*(i%40==0)+".#"[x-2<i%40<x+2]]for i,x in enumerate(accumulate([1]+[int(x)if x[-1].isdigit()else 0 for x in open("i").read().split()]))]))
79+
a,b=zip(*[[(i+1)*x*(i%40==19),"\n"*(i%40==0)+".#"[x-2<i%40<x+2]]for i,x in enumerate(accumulate([1]+[int(x)if x[-1].isdigit()else 0 for x in open("i").read().split()]))])
8080
print(sum(a),"".join(b))
8181
```
8282
```Python

day10/golfing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from itertools import*
2-
a,b=list(zip(*[[(i+1)*x*(i%40==19),"\n"*(i%40==0)+".#"[x-2<i%40<x+2]]for i,x in enumerate(accumulate([1]+[int(x)if x[-1].isdigit()else 0 for x in open("i").read().split()]))]))
2+
a,b=zip(*[[(i+1)*x*(i%40==19),"\n"*(i%40==0)+".#"[x-2<i%40<x+2]]for i,x in enumerate(accumulate([1]+[int(x)if x[-1].isdigit()else 0 for x in open("i").read().split()]))])
33
print(sum(a),"".join(b))

0 commit comments

Comments
 (0)