-
-
Save fivejjs/24554b7e04a4a95c03c80ab6ba5c9ba8 to your computer and use it in GitHub Desktop.
Longest Increasing Sub-Seq – Rich 4Clojure Problem 53 – See: https://github.com/PEZ/rich4clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns rich4clojure.hard.problem-053 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Longest Increasing Sub-Seq = | |
;; By 4Clojure user: dbyrne | |
;; Difficulty: Hard | |
;; Tags: [seqs] | |
;; | |
;; Given a vector of integers, find the longest | |
;; consecutive sub-sequence of increasing numbers. If two | |
;; sub-sequences have the same length, use the one that | |
;; occurs first. An increasing sub-sequence must have a | |
;; length of 2 or greater to qualify. | |
(def __ :tests-will-fail) | |
(comment | |
) | |
(tests | |
(__ [1 0 1 2 3 0 4 5]) := [0 1 2 3] | |
(__ [5 6 1 3 2 7]) := [5 6] | |
(__ [2 3 3 4 5]) := [3 4 5] | |
(__ [7 6 5 4]) := []) | |
;; To participate, fork: | |
;; https://github.com/PEZ/rich4clojure | |
;; Post your solution below, please! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment