給予一堆字串,用字首字母排序後,回傳第一個字串,並在字母間 insert "***"
(deftest a-test1
(testing "Test1"
(is (= (star-sort ["bitcoin" "take" "over" "the" "world" "maybe" "who" "knows" "perhaps"])
"b***i***t***c***o***i***n"))))
(ns clojure.star-sort)
(defn star-sort [arr]
(apply str (interpose "***" (flatten (partition 1 (first (sort arr))))))
)
(ns clojure.star-sort)
(defn star-sort [arr]
(clojure.string/join "***" (first (sort arr))))