def test1(self): input_str = 'cabababcdab' candidates = 'abcd' res = foo(input_str, candidates) answer = 4 self.assertEqual(answer, res) print res
def test1(self): A = [2, 3, 4] B = [1, 2, 3, 5] res = foo(A, B) answer = [2, 3] self.assertListEqual(answer, res) print res
def test2(self): input_str = 'cdbcdbcdbbccda' candidates = 'abcd' res = foo(input_str, candidates) answer = 3 self.assertEqual(answer, res) print res
def test1(self): d = {'a': 0.25, 'b': 0.25, 'c': 0.5} res = {} for i in range(10000): c = foo(d) res[c] = res.get(c, 0) + 1 print res
def test1(self): input = [1, 2, 3, 0, 0, 1, 2, 0] foo(input) print input
def test4(self): input = [1] * 3 + [0] * 10 + [8] * 10 foo(input) print input
def test3(self): input = [1] * 3 + [0] * 10 foo(input) print input
def test2(self): input = [0] * 10 foo(input) print input
def test1(self): A = [[1, 1], 2, [1, 1]] res = foo(A) self.assertEqual(10, res)
def test2(self): A = [1, [4, [6]]] res = foo(A) self.assertEqual(27, res)