I can't wait to see all of your solutions to P27. This problem has given me such a headache :P
Announcement: there's a bioinformatics programming competition starting today and we can use whatever language(s) we like: stepik.org/course/91751/syllabus