Sha256: 57593050c9e41e6dd271ccd8128f5daa6e4a49ee61e9f141a65b406537dd9765
Contents?: true
Size: 448 Bytes
Versions: 395
Compression:
Stored size: 448 Bytes
Contents
;;; nucleotide-count.el --- nucleotide-count Exercise (exercism) ;;; Commentary: ;;; Code: (defun nucleotide-count (sequence) (let ((counts (copy-alist '((?A . 0) (?C . 0) (?G . 0) (?T . 0))))) (dolist (i (append sequence nil)) (let ((n (assoc i counts))) (if n (setcdr n (1+ (cdr n))) (error "Invalid nucleotide '%c'" i)))) counts)) (provide 'nucleotide-count) ;;; nucleotide-count.el ends here
Version data entries
395 entries across 395 versions & 1 rubygems