File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,11 @@ def move(self):
98
98
99
99
print ("initializing..." )
100
100
101
- cups = Cups (list (map (int , "538914762" )) + list (range (10 , 1000001 )))
101
+ cups = Cups (list (map (int , "538914762" )) + list (range (10 , 1_000_001 )))
102
102
103
- print ("calculating, please wait about 70 sec..." )
103
+ print ("calculating, please wait about 17 sec..." )
104
104
105
- for _ in range (10000000 ):
105
+ for _ in range (10_000_000 ):
106
106
cups .move ()
107
107
108
108
print (cups .by_value [1 ].next .value * cups .by_value [1 ].next .next .value )
Original file line number Diff line number Diff line change @@ -38,8 +38,6 @@ def solve(zerotonine):
38
38
'abcdfg' , # 9
39
39
]
40
40
41
- found = False
42
-
43
41
for p in permutations ('abcdefg' ):
44
42
encode_table = str .maketrans ('abcdefg' , '' .join (p ))
45
43
test_digits = [ set (d .translate (encode_table )) for d in digits ]
@@ -48,10 +46,9 @@ def solve(zerotonine):
48
46
break
49
47
test_digits .remove (set (z ))
50
48
if len (test_digits ) == 0 :
51
- found = True
52
49
break
53
-
54
- assert found
50
+ else :
51
+ raise Exception ( "not found" )
55
52
56
53
encoded_digits = [ set (d .translate (encode_table )) for d in digits ]
57
54
def decoder (n ):
You can’t perform that action at this time.
0 commit comments