Exemplo n.º 1
0
 def test_trivial_case(self):
     self.assertEqual(lastDigitNaive(3, 7), 1)
     self.assertEqual(lastDigitNaive(10, 10), 5)
     self.assertEqual(lastDigitNaive(10, 200), 2)
     self.assertEqual(lastDigitSolution(3, 7), 1)
     self.assertEqual(lastDigitSolution(10, 10), 5)
     self.assertEqual(lastDigitSolution(10, 200), 2)
Exemplo n.º 2
0
 def test_stress(self):
     for dummy_ind in range(100):
         n = random.randint(2, 1e5)
         print n
         self.assertEqual(lastDigitNaive(n), lastDigitSolution(n))
Exemplo n.º 3
0
 def test_trivial_case(self):
     self.assertEqual(lastDigitNaive(3), 2)
     self.assertEqual(lastDigitNaive(331), 9)
     self.assertEqual(lastDigitSolution(3), 2)
     self.assertEqual(lastDigitSolution(331), 9)
     self.assertEqual(lastDigitSolution(327305), 5)
Exemplo n.º 4
0
 def test_stress(self):
     for dummy_ind in range(100):
         m = random.randint(2, 1e7)
         n = random.randint(m, 1e7)
         print m, n
         self.assertEqual(lastDigitNaive(m, n), lastDigitSolution(m, n))
Exemplo n.º 5
0
 def test_trivial_case(self):
     self.assertEqual(lastDigitNaive(3), 4)
     self.assertEqual(lastDigitNaive(100), 5)
     self.assertEqual(lastDigitSolution(3), 4)
     self.assertEqual(lastDigitSolution(100), 5)