rosalind dynamic programming