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)
def test_stress(self): for dummy_ind in range(100): n = random.randint(2, 1e5) print n self.assertEqual(lastDigitNaive(n), lastDigitSolution(n))
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)
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))
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)