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