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