namespace Day24; public class HailStorm { private readonly IList _hail; public HailStorm(IList hail) { _hail = hail; } public long Count(double min, double max) { var count = 0L; for (var i = 0; i < _hail.Count - 1; i++) { for (var j = i + 1; j < _hail.Count; j++) { var intersection = _hail[i].IntersectionWith(_hail[j]); //Console.WriteLine($"{i} v {j} => {intersection.X} / {intersection.Y} @ {intersection.T1} & {intersection.T2}"); //Console.WriteLine($"Within Limits: {intersection.IsValid(min, max)}"); if (intersection.IsValid(min, max)) { count++; } } } return count; } }