Skip to content

Commit 345cc08

Browse files
committed
added larsks-gist-3695375.py
1 parent 21de8b1 commit 345cc08

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/python
2+
3+
import sys
4+
import json
5+
from collections import defaultdict
6+
7+
data1 = defaultdict(lambda: 0)
8+
data2 = defaultdict(list)
9+
data3 = {
10+
'counts': defaultdict(lambda: 0),
11+
'id_by_type': defaultdict(list),
12+
}
13+
data4 = []
14+
15+
for line in sys.stdin:
16+
id, type, priority = line.strip().split()
17+
18+
data1[type] += 1
19+
data2[type].append(id)
20+
data3['counts'][type] += 1
21+
data3['id_by_type'][type].append(id)
22+
23+
data4.append(id)
24+
25+
26+
final = [data1, data2, data3, data4]
27+
28+
print json.dumps(final, indent=2)

katas/autovivification/t/go.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ my @solutions = qw{
88
pdurbin.rb
99
agoddard.rb
1010
};
11+
#larsks-gist-3695375.py
1112

1213
my $num_tests = scalar @solutions;
1314

0 commit comments

Comments
 (0)