diff options
author | Andinus <andinus@nand.sh> | 2021-08-11 15:26:15 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-08-11 15:26:15 +0530 |
commit | 321825828ac918bad28d0597a8616c6dc9802c3c (patch) | |
tree | 0b8e9cb1012197750eb58e972736319b2a6abac2 /go/nucleotide-count/nucleotide_count.go | |
parent | 2979ef790ac5b8f58495e0dd08cafd6a3a2e30a5 (diff) | |
download | exercism-321825828ac918bad28d0597a8616c6dc9802c3c.tar.gz |
Add solved exercises
Diffstat (limited to 'go/nucleotide-count/nucleotide_count.go')
-rw-r--r-- | go/nucleotide-count/nucleotide_count.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/go/nucleotide-count/nucleotide_count.go b/go/nucleotide-count/nucleotide_count.go new file mode 100644 index 0000000..1fb532c --- /dev/null +++ b/go/nucleotide-count/nucleotide_count.go @@ -0,0 +1,19 @@ +package dna + +// Histogram is a mapping from nucleotide to its count in given DNA. +// Choose a suitable data type. +type Histogram + +// DNA is a list of nucleotides. Choose a suitable data type. +type DNA + +// Counts generates a histogram of valid nucleotides in the given DNA. +// Returns an error if d contains an invalid nucleotide. +/// +// Counts is a method on the DNA type. A method is a function with a special receiver argument. +// The receiver appears in its own argument list between the func keyword and the method name. +// Here, the Counts method has a receiver of type DNA named d. +func (d DNA) Counts() (Histogram, error) { + var h Histogram + return h, nil +} |