export class NucleotideCount {
static parse(dna) {
if (/[^ACGT]/.test(dna)) throw new Error('Invalid nucleotide in strand');
const counts = { A: 0, C: 0, G: 0, T: 0 };
for (const char of dna) counts[char]++;
return `${counts.A} ${counts.C} ${counts.G} ${counts.T}`;
}
}