golf
This commit is contained in:
parent
fdd38bd6b1
commit
b0d0cf5b59
@ -28,19 +28,17 @@
|
||||
op-idx 0
|
||||
curr-nums []
|
||||
acc 0]
|
||||
(let [op (get ops op-idx)
|
||||
ans (+ acc (apply op curr-nums))]
|
||||
(if (> col-idx MAX_LINE_IDX)
|
||||
(+ acc (apply (get ops op-idx) curr-nums))
|
||||
ans
|
||||
(let [col (->> nums-raw
|
||||
(map #(.charAt % col-idx))
|
||||
(filter (partial not= \space))
|
||||
(map #(- (int %) (int \0))))
|
||||
op (get ops op-idx)]
|
||||
(map #(- (int %) (int \0))))]
|
||||
(if (empty? col)
|
||||
(recur (inc col-idx)
|
||||
(inc op-idx)
|
||||
[]
|
||||
(+ acc (apply op curr-nums)))
|
||||
(recur (inc col-idx) (inc op-idx) [] ans)
|
||||
(recur (inc col-idx)
|
||||
op-idx
|
||||
(conj curr-nums (parse-long (apply str col)))
|
||||
acc)))))
|
||||
acc))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user