#342
We found a match (or some matches)
Difficulty: | Easy |
Topics: | List and vector |
Mission: Create a function that takes 2 arguments, first argument is a predicate function, second argument is the collection. Returns the index of position in 2nd arg the elements that satisfy the predicate function in 1st arg.
(= (__ #(> % 2) [1 2 3 4 5]) [2 3 4]) | |
(= (__ #(instance? String %) [true "Clojure" false "Scala" 42]) [1 3]) | |
(= (__ odd? [1 2 3 4 5]) [0 2 4]) | |
(= (__ #(clojure.string/includes? % "ad") ["adbas" "sad" "fadjar" "jumawa" "bastard" "bastad"]) [0 1 2 5]) |