-
Notifications
You must be signed in to change notification settings - Fork 0
/
pb185.py
60 lines (58 loc) · 1.54 KB
/
pb185.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#56161 5650518293 ;2 correct
#384743964729 0 7 ;1 correct
#5855462940810587 ;3 correct
#9742855507068353 ;3 correct
#42968496436 75 3 ;3 correct
#3174248439465 58 ;1 correct
#451355909 146117 ;2 correct
#7890971548908067 ;3 correct
#8157 5 34 118483 ;1 correct
# 61525074 86 99 ;2 correct
#8690095851526254 ;3 correct
#6375711915077050 ;1 correct
#6913859 73121360 ;1 correct
#2321386104303845 ;0 correct
#64428 9055042768 ;2 correct
# 65094712714 8 ;2 correct
#525 5 3379644322 ;2 correct
#1748270476758276 ;3 correct
#4895722652190306 ;1 correct
#304 631 1722463 ;3 correct
#184 23 45 24589 ;3 correct
# 659862637 16 67 ;2 correct
pb = {'5616185650518293' :2,
'3847439647293047' :1,
'5855462940810587' :3,
'9742855507068353' :3,
'4296849643607543' :3,
'3174248439465858' :1,
'4513559094146117' :2,
'7890971548908067' :3,
'8157356344118483' :1,
'2615250744386899' :2,
'8690095851526254' :3,
'6375711915077050' :1,
'6913859173121360' :1,
'6442889055042768' :2,
'2321386104303845' :0,
'2326509471271448' :2,
'5251583379644322' :2,
'1748270476758276' :3,
'4895722652190306' :1,
'3041631117224635' :3,
'1841236454324589' :3,
'2659862637316867' :2}
pb = {'90342' :2, '70794' :0, '39458' :2, '34109' :1, '51545' :2, '12531' :1}
d = {(i+1): range(0, 10) for i in range(len(pb.keys()[0]))}
for i, j in pb.items():
if j == 0:
for k, n in enumerate(i):
if int(n) in d[k + 1]:
d[k + 1].remove(int(n))
print d
for i in range(len(pb.keys()[0])):
s = set()
for j in pb:
s.add(int(j[i]))
d[i+1] = list(set(d[i+1]) & s)
print d