Beispiel #1
0
	def test_case_1(self):
		self.assertEqual(program.largestRange([1]), [1, 1])
Beispiel #2
0
	def test_case_10(self):
		self.assertEqual(program.largestRange([0, -5, 9, 19, -1, 18, 17, 2, -4, -3, 10, 3, 12, 5, 16, 4, 11, 7, -6, -7, 6, 15, 12, 12, 2, 1, 6, 13, 14, -2]), [-7, 7])
Beispiel #3
0
	def test_case_11(self):
		self.assertEqual(program.largestRange([-7, -7, -7, -7, 8, -8, 0, 9, 19, -1, -3, 18, 17, 2, 10, 3, 12, 5, 16, 4, 11, -6, 8, 7, 6, 15, 12, 12, -5, 2, 1, 6, 13, 14, -4, -2]), [-8, 19])
Beispiel #4
0
	def test_case_8(self):
		self.assertEqual(program.largestRange([0, 9, 19, -1, 18, 17, 2, 10, 3, 12, 5, 16, 4, 11, 8, 7, 6, 15, 12, 12, 2, 1, 6, 13, 14]), [-1, 19])
Beispiel #5
0
	def test_case_6(self):
		self.assertEqual(program.largestRange([1, 11, 3, 0, 15, 5, 2, 4, 10, 7, 12, 6]), [0, 7])
Beispiel #6
0
	def test_case_5(self):
		self.assertEqual(program.largestRange([8, 4, 2, 10, 3, 6, 7, 9, 1]), [6, 10])
Beispiel #7
0
	def test_case_4(self):
		self.assertEqual(program.largestRange([4, 2, 1, 3, 6]), [1, 4])
Beispiel #8
0
1
import program
2
import unittest
3
​
4
​
5
class TestProgram(unittest.TestCase):
6
​
7
    def test_case_1(self):
8
        self.assertEqual(program.largestRange([1]), [1, 1])
9
​
10
    def test_case_2(self):
11
        self.assertEqual(program.largestRange([1, 2]), [1, 2])
12
​
13
    def test_case_3(self):
14
        self.assertEqual(program.largestRange([4, 2, 1, 3]), [1, 4])
15
​
16