You are viewing a single comment's thread. Return to all comments →
In clojure, using lazy sequences:
(let [testcases (Integer/parseInt (read-line))]
(loop [n testcases]
(let [input-str (read-line)]
(println (apply str (map str
(take-nth 2 (subs input-str 1))
(take-nth 2 input-str)))))
(if (> n 0)
(recur (- n 1)))))
(partition 2) could save you a lot of work here.
Also, have you looked into using (doseq) instead of (loop)?