day15 much faster
This commit is contained in:
parent
b83bb6b37a
commit
3d00f265ca
3 changed files with 145 additions and 38 deletions
|
|
@ -20,14 +20,14 @@ def test_part2():
|
|||
|
||||
def test_parse():
|
||||
input = "Sensor at x=2, y=18: closest beacon is at x=-2, y=15"
|
||||
expected = Sensor(Position(2, 18), 7), Position(-2, 15)
|
||||
result = Sensor.parse(input)
|
||||
expected = Sensor(1, Position(2, 18), 7), Position(-2, 15)
|
||||
result = Sensor.parse(input, 1)
|
||||
assert result == expected
|
||||
|
||||
|
||||
def test_x_range():
|
||||
input = "Sensor at x=8, y=7: closest beacon is at x=2, y=10"
|
||||
sensor, _ = Sensor.parse(input)
|
||||
sensor, _ = Sensor.parse(input, 1)
|
||||
assert sensor.col_range_at_row(10) == (2, 14)
|
||||
assert sensor.col_range_at_row(11) == (3, 13)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue