src/problems/spec.lisp @ 7fcd748a4f00

LCSQ, PRSM
author Steve Losh <steve@stevelosh.com>
date Mon, 08 Aug 2022 19:00:58 -0400
parents cd3fc11e3298
children (none)
(defpackage :rosalind/spec (:use :cl :rosalind :losh :iterate))
(in-package :rosalind/spec)

(defparameter *input* "3524.8542
3710.9335
3841.974
3970.0326
4057.0646")

(defparameter *output* "WMQS")


(define-problem spec (data stream) *input* *output*
  (let* ((*read-default-float-format* 'rational)
         (prefix-weights (u:read-lines data :key #'read-from-string))
         (weights (mapcar #'- (rest prefix-weights) prefix-weights))
         (result (mapcar #'u:residue-with-mass weights)))
    (string-join "" result)))