Ejemplo n.º 1
0
 def test_fromlist(self):
     l = [1, 2, 3, 10, 12, 16]
     r = Interval.fromlist(l)
     print(Interval.tolist(r))
Ejemplo n.º 2
0
 def test_insertintervals(self):
     s = LeetSolution()
     r = s.insertintervals(Interval.fromlist([1, 3, 6, 9]), Interval(2, 5))
     self.assertEqual([1, 5, 6, 9], Interval.tolist(r))
     r = s.insertintervals(Interval.fromlist([1, 2, 3, 5, 6, 7, 8, 10, 12, 16]), Interval(4, 9))
     self.assertEqual([1, 2, 3, 10, 12, 16], Interval.tolist(r))