Пример #1
0
        public static void MergeIntervals()
        {
            var obj   = new CareerCupQnA();
            var input = new List <Interval>
            {
                new Interval(1, 100),
                new Interval(250, 550),
                new Interval(1000, 1200),
                new Interval(400, 600),
                new Interval(800, 900),
                new Interval(1100, 1150),
            };

            obj.MergeIntervals(input);

            foreach (var v in obj.ListOfInterval)
            {
                Console.WriteLine("{0}, {1}", v.Start, v.End);
            }
        }