Beispiel #1
0
 def test_combination_memo(self):
     self.assertEqual(10272278170, combination_memo(50, 10))
     self.assertEqual(847660528, combination_memo(40, 10))
 def test_combination_memo(self):
     self.assertEqual(10272278170, combination_memo(50, 10))
     self.assertEqual(847660528, combination_memo(40, 10))
from algorithms.maths import combination, combination_memo

print(combination(5, 3))

print(combination_memo(5, 3))

from itertools import combinations

alist = [i for i in range(5)]
comb = combinations(alist, 3)
count = 0
for i in comb:
    print(i)
    count += 1
print(count)