Codewars Bar recommends you drink 1 glass of water per standard drink so you're not hungover tomorrow morning.
Your fellow coders have bought you several drinks tonight in the form of a string. Return a string suggesting how many glasses of water you should drink to not be hungover.
記算字串中總共有多少杯酒,回傳相同數量的水
"1 beer" => "1 glass of water"
"1 shot, 5 beers and 1 glass of wine" => "7 glasses of water"
(ns hydrate)
(defn hydrate [drink-string]
(def glasses (apply + (map #(Integer/parseInt (str %)) (filter #(Character/isDigit %) drink-string))))
(str glasses (if (= glasses 1) " glass of water" " glasses of water"))
)