src/problems/subs.lisp @ ca95211a2d98
RSTR
author |
Steve Losh <steve@stevelosh.com> |
date |
Fri, 22 Feb 2019 19:32:24 -0500 |
parents |
11df545d1a41 |
children |
c26fa4d063ba |
(in-package :rosalind)
(defparameter *input-subs* "GATATATGCATATACTT
ATAT")
(defparameter *output-subs* "2 4 10")
(define-problem subs (data stream)
*input-subs*
*output-subs*
(let ((haystack (read-line data))
(needle (read-line data)))
(iterate
(for pos :seed -1 :then (search needle haystack :start2 (1+ pos)))
(while pos)
(collect (1+ pos) :into result)
(finally (return (str:join " " result))))))
;; (problem-subs)
;; (solve subs)