from collections import Counter
>>> from itertools import chain
>>> def most_pop(pop):
… pop_flat = chain.from_iterable(range(i,j+1) for i,j in pop)
… return Counter(pop_flat).most_common()
…
>>> most_pop([(1920, 1939), (1911, 1944), (1920, 1955), (1938, 1939)])[0]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)