Here is some solutions which were written to take the Bioinformatics algorithms course on Coursera from The University of California, San Diego.
Now this course looks a bit different, but I don’t think that the tasks have changed a lot. So you can't directly copy my code, but let take some hints if you are up a gum.
Note that I originally wrote my code in C++, and then switched to python to write faster.