Rosalind - Enumerating Gene Orders

rosalind

Problem:

Please find the problem here.

Solution:

A simple recursive solution is to pick one out of the list, and compute the permutation of the rest. The problem is, how do we represent ’the rest’? My approach is that we make sure the suffix of the list is ’the rest’, and therefore we can simply use an integer to represent the rest.

Code: