clojure solution for a little stocks dp question i made up