Skip to content

Commit

Permalink
updated No.56, 60, 75, 88
Browse files Browse the repository at this point in the history
  • Loading branch information
youz committed May 20, 2011
1 parent d3850a7 commit 9fe8200
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion 056_Find Distinct Items.clj
@@ -1 +1,3 @@
#(let[[x & r]%3](if(not x)%(recur(if(%2 x)%`[~@%~x])(conj%2 x)r)))[]#{}
(fn f [a [x & r]]
(if x (f (if ((set a) x) a (conj a x)) r) a))
[]
5 changes: 4 additions & 1 deletion 060_Sequence Reductions.clj
@@ -1 +1,4 @@
(fn f([g[h &%]](f g h%))([g%[h & r]](cons%(if h(lazy-seq(f g(g% h)r))))))
(fn f
([g [h & r]] (f g h r))
([g i [h & r]]
(cons i (if h (lazy-seq (f g (g i h) r))))))
5 changes: 4 additions & 1 deletion 075_Euler's Totient Function.clj
@@ -1 +1,4 @@
(fn[n](+(count(filter(fn[i](#(if(=%2 0)(=% 1)(recur%2(mod%%2)))n i))(range 2 n)))1))
(fn [n]
(+ 1 (count
(filter (fn [i] (= (str i '/ n) (str (/ i n))))
(range 2 n)))))
2 changes: 1 addition & 1 deletion 088_Symmetric Difference.clj
@@ -1 +1 @@
#(reduce conj(%%2%3)(%%3%2))clojure.set/difference
reduce #((if (% %2) disj conj) % %2)

0 comments on commit 9fe8200

Please sign in to comment.