You are viewing a single comment's thread. Return to all comments →
from itertools import permutations N = int(input()) s = input().split() k = int(input()) count = sum(1 for data in permutations(s, k) if 'a' in data) print(count/len(list(permutations(s, k))))
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 →