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