diff --git a/problem3.py b/problem3.py index bcc0a19..35dcc9d 100644 --- a/problem3.py +++ b/problem3.py @@ -11,14 +11,8 @@ for line in my_input: p1 += l_high - l_low + 1 p1 += r_high - r_low + 1 - if r_low < l_low: - l_low, l_high, r_low, r_high = r_low, r_high, l_low, l_high - - if l_high < r_low: - this_box_set = set(range(l_low, l_high + 1)) - this_box_set |= set(range(r_low, r_high + 1)) - else: - this_box_set = set(range(min(l_low, r_low), max(l_high, r_high) + 1)) + this_box_set = set(range(l_low, l_high + 1)) + this_box_set |= set(range(r_low, r_high + 1)) p2 += len(this_box_set) if len(this_box_set | last_boxes) > p3: