INI6 - maccergit/Rosalind GitHub Wiki

The last of the Python Village problems - a classic hash-table problem.

001

Again, the obvious procedural approach.

002

By using the collections.Counter class and nested comprehensions, we get a more functional approach for the solution. The nested comprehensions are used to flatten the list of lists of words to being a simple list of words. By using a library to count the words, we may get benefits of using code or approaches that are not normally available to us in plain Python.

003

Still uses Counter, but the list flattening uses the itertools library, so it's a bit more obvious what is going on.