File tree 2 files changed +4
-2
lines changed 2 files changed +4
-2
lines changed File renamed without changes.
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ def row_coverage(intersections):
60
60
if __name__ == '__main__' :
61
61
inputs = (line .rstrip ('\n ' ) for line in open (sys .argv [1 ]))
62
62
63
+
63
64
pairs = []
64
65
65
66
for line in inputs :
@@ -74,15 +75,16 @@ def row_coverage(intersections):
74
75
start = timer ()
75
76
76
77
beacons = set (b for _ , b in pairs )
77
- intersections = scan (int (sys .argv [2 ]), pairs )
78
+ scan_row = int (sys .argv [2 ]) if len (sys .argv ) >= 3 else 2000000
79
+ intersections = scan (scan_row , pairs )
78
80
covered = row_coverage (intersections )
79
81
covered -= beacons
80
82
81
83
end = timer ()
82
84
83
85
print (f'part 1: { len (covered )} { end - start :.6f} seconds' )
84
86
85
- max_coord = int (sys .argv [3 ])
87
+ max_coord = int (sys .argv [3 ]) if len ( sys . argv ) >= 4 else 4000000
86
88
87
89
start = timer ()
88
90
You can’t perform that action at this time.
0 commit comments