This file contains 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.easy.problem-173 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Intro to Destructuring 2 = | |
;; By 4Clojure user: hangkous | |
;; Difficulty: Easy | |
;; Tags: [Destructuring] | |
;; | |
;; Sequential destructuring allows you to bind symbols to | |
;; parts of sequential things (vectors, lists, seqs, |
This file contains 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.medium.problem-171 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Intervals = | |
;; By 4Clojure user: aiba | |
;; Difficulty: Medium | |
;; | |
;; Write a function that takes a sequence of integers and | |
;; returns a sequence of "intervals". Each interval is a a | |
;; vector of two integers, start and end, such that all |
This file contains 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.medium.problem-168 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Infinite Matrix = | |
;; By 4Clojure user: maximental | |
;; Difficulty: Medium | |
;; Tags: [seqs recursion math] | |
;; | |
;; In what follows, m, n, s, t denote nonnegative | |
;; integers, f denotes a function that accepts two |
This file contains 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.easy.problem-166 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Comparisons = | |
;; By 4Clojure user: daowen | |
;; Difficulty: Easy | |
;; | |
;; For any orderable data type it's possible to derive all | |
;; of the basic comparison operations (<, ≤, =, ≠, ≥, and | |
;; >) from a single operation (any operator but = or ≠ |
This file contains 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-164 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Language of a DFA = | |
;; By 4Clojure user: daowen | |
;; Difficulty: Hard | |
;; Tags: [automata seqs] | |
;; | |
;; A deterministic finite automaton (DFA) is an abstract | |
;; machine that recognizes a regular language. Usually a |
This file contains 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.elementary.problem-162 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Logical falsity and truth = | |
;; By 4Clojure user: hangkous | |
;; Difficulty: Elementary | |
;; Tags: [logic] | |
;; | |
;; In Clojure, only nil and false represent the values of | |
;; logical falsity in conditional tests - anything else is |
This file contains 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.elementary.problem-161 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Subset and Superset = | |
;; By 4Clojure user: hangkous | |
;; Difficulty: Elementary | |
;; Tags: [set-theory] | |
;; | |
;; Set A is a subset of set B, or equivalently B is a | |
;; superset of A, if A is "contained" inside B. A and B |
This file contains 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.medium.problem-158 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Decurry = | |
;; By 4Clojure user: amcnamara | |
;; Difficulty: Medium | |
;; Tags: [partial-functions] | |
;; | |
;; Write a function that accepts a curried function of | |
;; unknown arity n. Return an equivalent function of n |
This file contains 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.easy.problem-157 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Indexing Sequences = | |
;; By 4Clojure user: jaycfields | |
;; Difficulty: Easy | |
;; Tags: [seqs] | |
;; | |
;; Transform a sequence into a sequence of pairs | |
;; containing the original elements along with their |
This file contains 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.elementary.problem-156 | |
(:require [hyperfiddle.rcf :refer [tests]])) | |
;; = Map Defaults = | |
;; By 4Clojure user: jaycfields | |
;; Difficulty: Elementary | |
;; Tags: [seqs] | |
;; | |
;; When retrieving values from a map, you can specify | |
;; default values in case the key is not found: |