Last active
January 20, 2023 01:05
-
-
Save PEZ/efa257369fd08ba1dcef6bec34d04ede to your computer and use it in GitHub Desktop.
Indexing Sequences – Rich 4Clojure Problem 157 – See: https://github.com/PEZ/rich4clojure
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 | |
;; index. | |
(def __ :tests-will-fail) | |
(comment | |
) | |
(tests | |
(__ [:a :b :c]) := [[:a 0] [:b 1] [:c 2]] | |
(__ [0 1 3]) := '((0 0) (1 1) (3 2)) | |
(__ [[:foo] {:bar :baz}]) := [[[:foo] 0] [{:bar :baz} 1]]) | |
;; To participate, fork: | |
;; https://github.com/PEZ/rich4clojure | |
;; Post your solution below, please! |
onstop4
commented
Jan 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment