 <p>a few notes / pointers about doing this in python.</p> <ol> <li>Use the <a href="http://docs.python.org/library/bisect.html" rel="nofollow">bisect module</a> to keep your result array in order to easily spot potential non-uniques. This is helpful even if <code>v1</code> is already sorted (e.g. <code>name</code> and <code>enemy</code> will collide after disenvoweling)</li> <li>Disemvoweling can be achieved by simple calling <code>.translate(None, "aeiouyAEIOUY")</code> on the string.</li> <li>In case of duplicates you could try to resolve the collisions first by lowercasing all results and using swapcase as "bitmask", i.e. multiple occurences of aaa become <code>["aaa", "aaA", "aAa", "aAA"]</code> etc. and if this is not enough "incrementing" characters starting from the end, until a non-colliding identifier is found, eg. <code>["aa"]*7</code> would become [<code>"aa", "aA", "Aa", "AA", "ab", "aB", "Ab"]</code></li> </ol>