Count

Words
29
Reading
1 min
Listen
Play
2y

class NucleotideCount {

​

static count(strand) {

    def nucleotides = ['A': 0, 'C': 0, 'G': 0, 'T': 0].withDefault {throw new ArithmeticException()}

    strand.each { nucleotides[it] += 1}

    nucleotides

} 

}

Count | Ecency