solved rosalind algo HDAG