Exemple #1
0
 def testLeftNoneCase(self):
     arr = [-10, -8, -5, -1]
     self.assertEqual(smallestIndexSameAsNumber(arr), None)
Exemple #2
0
 def testExampleCase(self):
     arr = [-5, -3, 2, 3]
     self.assertEqual(smallestIndexSameAsNumber(arr), 2)
Exemple #3
0
 def testLeftmostCase(self):
     arr = [-10, -9, -6, -4, 4]
     self.assertEqual(smallestIndexSameAsNumber(arr), 4)
Exemple #4
0
 def testRightMostCase(self):
     arr = [0, 5, 34, 67, 100]
     self.assertEqual(smallestIndexSameAsNumber(arr), 0)
Exemple #5
0
 def testRightNoneCase(self):
     arr = [2, 3, 4, 5]
     self.assertEqual(smallestIndexSameAsNumber(arr), None)