Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Ordered-words/Clojure/ordered-words-1.clj
Normal file
15
Task/Ordered-words/Clojure/ordered-words-1.clj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(defn is-sorted? [coll]
|
||||
(not-any? pos? (map compare coll (next coll))))
|
||||
|
||||
(defn take-while-eqcount [coll]
|
||||
(let [n (count (first coll))]
|
||||
(take-while #(== n (count %)) coll)))
|
||||
|
||||
(with-open [rdr (clojure.java.io/reader "unixdict.txt")]
|
||||
(->> rdr
|
||||
line-seq
|
||||
(filter is-sorted?)
|
||||
(sort-by count >)
|
||||
take-while-eqcount
|
||||
(clojure.string/join ", ")
|
||||
println))
|
||||
1
Task/Ordered-words/Clojure/ordered-words-2.clj
Normal file
1
Task/Ordered-words/Clojure/ordered-words-2.clj
Normal file
|
|
@ -0,0 +1 @@
|
|||
abbott, accent, accept, access, accost, almost, bellow, billow, biopsy, chilly, choosy, choppy, effort, floppy, glossy, knotty
|
||||
Loading…
Add table
Add a link
Reference in a new issue