Skip to content

Commit

Permalink
Problem added: Simple Recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
dbyrne committed Apr 24, 2011
1 parent bf73615 commit 13be67a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/foreclojure/data_set.clj
Expand Up @@ -571,4 +571,23 @@
:tags ["medium" "seqs" "core-functions"]
:tests ["(= (__ [1 2 1 3 1 2 4]) [1 2 3 4])"
"(= (__ [:a :a :b :b :c :c]) [:a :b :c])"
"(= (__ '([2 4] [1 2] [1 3] [1 3])) '([2 4] [1 2] [1 3]))"]})))
"(= (__ '([2 4] [1 2] [1 3] [1 3])) '([2 4] [1 2] [1 3]))"]})

(insert! :problems
{:_id 56
:title "Find Distinct Items"
:times-solved 0
:restricted ["distinct"]
:description "Write a function which removes the duplicates from a sequence. Order of the items must be maintained."
:tags ["medium" "seqs" "core-functions"]
:tests ["(= (__ [1 2 1 3 1 2 4]) [1 2 3 4])"
"(= (__ [:a :a :b :b :c :c]) [:a :b :c])"
"(= (__ '([2 4] [1 2] [1 3] [1 3])) '([2 4] [1 2] [1 3]))"]})

(insert! :problems
{:_id 57
:title "Simple Recursion"
:times-solved 0
:description "A recursive function is a function which calls itself. This is one of the fundamental techniques used in functional programming."
:tags ["elementary" "recursion"]
:tests ["(= __ ((fn foo [x] (when (> x 0) (conj (foo (dec x)) x))) 5))"]})))

0 comments on commit 13be67a

Please sign in to comment.