Пример #1
0
 def test_example_2(self):
     assert Solution().insert(
         intervals=[[1, 2], [3, 5], [6, 7], [8, 10], [12, 16]], newInterval=[4, 8]
     ) == [[1, 2], [3, 10], [12, 16]]
Пример #2
0
 def test_example_1(self):
     assert Solution().insert(intervals=[[1, 3], [6, 9]], newInterval=[2, 5]) == [
         [1, 5],
         [6, 9],
     ]
Пример #3
0
 def test_sample_1(self):
     self.assertEqual(Solution().insert([[1, 3], [6, 9]], [2, 5]),
                      [[1, 5], [6, 9]])
Пример #4
0
 def test_sample_2(self):
     self.assertEqual(
         Solution().insert([[1, 2], [3, 5], [6, 7], [8, 10], [12, 16]],
                           [4, 8]), [[1, 2], [3, 10], [12, 16]])
Пример #5
0
 def test_129(self):
     self.assertEqual(Solution().insert([[1, 5]], [0, 3]), [[0, 5]])
Пример #6
0
 def test_98(self):
     self.assertEqual(Solution().insert([[1, 5]], [6, 8]), [[1, 5], [6, 8]])
Пример #7
0
 def test_75(self):
     self.assertEqual(Solution().insert([[1, 5]], [5, 7]), [[1, 7]])
Пример #8
0
 def test_sample_5(self):
     self.assertEqual(Solution().insert([[1, 5]], [2, 7]), [[1, 7]])
Пример #9
0
 def test_sample_3(self):
     self.assertEqual(Solution().insert([], [5, 7]), [[5, 7]])