コード例 #1
0
ファイル: Wire.cs プロジェクト: tlwalker/advent-of-code-2019
 public List <Location> Intersects(Wire other) => _locations.Intersect(other._locations).ToList();
コード例 #2
0
ファイル: Wire.cs プロジェクト: tlwalker/advent-of-code-2019
        public int GetMinimalStepsToIntersect(Wire other)
        {
            var intersections = Intersects(other);

            return(intersections.Min(i => GetStepsToPoint(i) + other.GetStepsToPoint(i)));
        }