コード例 #1
0
 def test_brutemaxarray_allnegative(self):
     actual = dac.brute_maxsubarray([-3, -1, -3])
     expected = (1, 1, -1)
     self.assertEqual(expected, actual)
コード例 #2
0
 def test_brutemaxarray_allpositive(self):
     actual = dac.brute_maxsubarray([1, 1, 1, 1])
     expected = (0, 3, 4)
     self.assertEqual(expected, actual)
コード例 #3
0
 def test_brutemaxarray_allNegativeExceptLast(self):
     actual = dac.brute_maxsubarray([-1, -1, -1, 17])
     expected = (3, 3, 17)
     self.assertEqual(expected, actual)
コード例 #4
0
 def test_brutemaxarray_singleelement(self):
     actual = dac.brute_maxsubarray([3])
     expected = (0, 0, 3)
     self.assertEqual(expected, actual)