You are viewing a single comment's thread. Return to all comments →
from itertools import combinations n = int(input()) s = input().split() m = int(input()) combine = list(combinations(s,m)) count = 0 for i in combine: if 'a' in i: count += 1 ratio = count/len(combine) print(ratio)
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 →