Solution for rosalind.info problems in JS