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