#54 Partition a Sequence
(fn myfn [num list]
(reverse
(
(fn [num list result]
(if (> num (count list) )
result
(recur num (nthrest list num) (conj result (take num list))))
) num list '()
)
)
)
#55 Count Occurrences
(fn myfn [list]
(zipmap
(map first (partition-by identity (sort list) ))
(map count (partition-by identity (sort list) ))
)
)
728x90
'프로그래밍 언어 노트 > Clojure' 카테고리의 다른 글
[Clojure] clojure 관련 사이트들 2 (0) | 2019.12.16 |
---|---|
[Clojure] 4Clojure 6 (0) | 2019.10.30 |
[Clojure] 4Clojure 4 (0) | 2019.07.21 |
[Clojure] 4Clojure Easy 3 (0) | 2019.07.13 |
[Clojure] 4Clojure Easy 2 (0) | 2019.07.10 |