You are viewing a single comment's thread. Return to all comments →
from itertools import combinations N = int(input()) A = list(input().split()) K = int(input()) B = list(combinations(A, K)) count = sum(1 for x in B if 'a' in x) print(count/len(B))
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 →