Building A Community

If the words obtained by permuting all the letters of ‘COMMUNITY’ are arranged in alphabetic order, what is the order of the word ‘CONUMMITY’?

11419 11421 11422 11420

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Fletcher Mattox
Jul 10, 2019
1
2
3
4
5
6
7
8
from itertools import permutations
word = list('community')
perm = permutations(word,len(word))
uniq = set()
for i in perm:
  uniq.add(''.join(i))
ordered = sorted(list(uniq))
print ordered.index('conummity') + 1

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...