You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n, s, k = int(input()), input().split(), int(input()) combines = list(combinations(s, k)) print(len([x for x in combines if 'a' in x]) / len(combines))
Seems like cookies are disabled on this browser, please enable them to open this website
Iterables and Iterators
You are viewing a single comment's thread. Return to all comments →