Object-Oriented Programming · Amazon · Medium
Requirements Given a collection of segments, where every segment is represented by two (x, y) endpoints. Return the distinct intersection points. Clarify with the interviewer whether a shared endpoint should be treated as an intersection. Support parallel segments, collinear segments that overlap, and degenerate segments whose length is zero. Examples Preparation Work through LC 149 (Max Points on a Line), then revisit the parametric formula for intersecting two segments by…
Checking your access…