Rakuten Interview Question

Codility task 2: Python problem related to counting the possible number of strings (Permutations) that satisfy a certain condition.