Skip to content

Commit

Permalink
Problem added - Juxtaposition
Browse files Browse the repository at this point in the history
  • Loading branch information
dbyrne committed Apr 25, 2011
1 parent 4f4c59c commit 2b52c29
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/foreclojure/data_set.clj
Expand Up @@ -603,4 +603,15 @@
:tests ["(= [3 2 1] ((__ rest reverse) [1 2 3 4]))" :tests ["(= [3 2 1] ((__ rest reverse) [1 2 3 4]))"
"(= 5 ((__ (partial + 3) second) [1 2 3 4]))" "(= 5 ((__ (partial + 3) second) [1 2 3 4]))"
"(= true ((__ zero? #(mod % 8) +) 3 5 7 9))" "(= true ((__ zero? #(mod % 8) +) 3 5 7 9))"
"(= \"HELLO\" ((__ #(.toUpperCase %) #(apply str %) take) 5 \"hello world\"))"]}))) "(= \"HELLO\" ((__ #(.toUpperCase %) #(apply str %) take) 5 \"hello world\"))"]})

(insert! :problems
{:_id 59
:title "Juxtaposition"
:times-solved 0
:restricted ["juxt"]
:description "Take a set of functions and return a new function that takes a variable number of arguments and returns a sequence containing the result of applying each function left-to-right to the argument list."
:tags ["medium" "higher-order-functions" "core-functions"]
:tests ["(= [21 6 1] ((__ + max min) 2 3 5 1 6 4))"
"(= [\"HELLO\" 5] ((__ #(.toUpperCase %) count) \"hello\"))"
"(= [2 6 4] ((__ :a :c :b) {:a 2, :b 4, :c 6, :d 8 :e 10}))"]})))

0 comments on commit 2b52c29

Please sign in to comment.