Skip to content

Commit fcafa64

Browse files
authored
Merge pull request #6 from gjbex/copilot/fix-601a86b7-6fb1-49ea-8dc9-a315f0d18d38
Fix interval generation inconsistency between naive and intersection tree implementations
2 parents b1f13b6 + a43ed9a commit fcafa64

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source_code/intersection_trees/intersection_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def generate_interval(max_end: int = 1_000_000_000) -> Interval:
148148
Returns
149149
-------
150150
Interval
151-
Tuple (start, end) such that end - start >= 1
151+
Tuple (start, end) such that end - start > 1
152152
153153
Raises
154154
------
@@ -159,7 +159,7 @@ def generate_interval(max_end: int = 1_000_000_000) -> Interval:
159159
raise ValueError(f"max_end must be at least 2, got {max_end}")
160160

161161
start = random.randint(0, max_end - 2)
162-
end = random.randint(start + 1, max_end)
162+
end = random.randint(start + 2, max_end)
163163
return start, end
164164

165165

0 commit comments

Comments
 (0)