假设我们有一个这样的数字列表:
nums = ['7', '8', '9', '4', '1', '0', '3', '0', '5', '7', '0', '7', '4', '8', '7', '8', '7', '9', '3', '2', '5', '4', '5', '5', '5', '6', '3', '8', '6', '2', '4', '3', '6', '5', '5', '6', '3', '2']
len(nums) 是 38
问题是我如何开发一个算法:
排列,nPr =
38! / (38 - 11)!
= 48,032,775,105,638,400 = 超过 48 千万亿
我试过 itertools