This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
set background=dark | |
" Return cursor to the previous position when this file was open last | |
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | |
\| exe "normal g'\"" | endif | |
filetype plugin indent on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/28 | |
(fn squash [xs] | |
(if (sequential? xs) | |
(mapcat squash xs) | |
(list xs))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/29 | |
(fn [s] (apply str (filter #(Character/isUpperCase %) s))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/30 | |
(fn [xs] | |
(reduce (fn [v x] (if (= x (last v)) v (conj v x))) [] xs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/31 | |
#(partition-by identity %) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/32 | |
#(mapcat (fn [x] [x x]) %) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/33 | |
(fn [xs n] | |
(mapcat #(replicate n %) xs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/34 | |
(fn [l h] (take (- h l) (iterate inc l))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/38 | |
(fn [& xs] (reduce (fn [a b] (if (> a b) a b)) 0 xs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; chrisvest's solution to http://4clojure.com/problem/39 | |
(fn [a b] (mapcat vector a b)) |
OlderNewer