You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n = int(input().strip()) A = tuple( input().strip().split(" ")) K = int(input().strip()) B = list(combinations(A,K)) print(len(list(filter( lambda x : "a" in x , B )))/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 →