You are viewing a single comment's thread. Return to all comments →
from itertools import combinations N = int(input().strip()) N_list = input().split() K = int(input().strip()) all_comb = list(combinations(N_list, K)) print(len([i for i in all_comb if 'a' in i])/len(all_comb))
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 →