k.go 218 B

12345678910
  1. package kata
  2. func DNAStrand(dna string) string {
  3. s := make([]rune, len(dna))
  4. complements := map[rune]rune{'A':'T', 'T':'A', 'C':'G', 'G': 'C'}
  5. for i, r := range dna {
  6. s[i] = complements[r]
  7. }
  8. return string(s)
  9. }