Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (let [in "68+249*201-87"
- pred (set "+*-/")]
- (second
- (last
- (take-while #(< (first %) 2)
- (reductions (fn [[count acc] item]
- [(if (pred item)
- (inc count)
- count)
- (conj acc item)])
- [0 []]
- in)))))
- [\6 \8 \+ \2 \4 \9]
Add Comment
Please, Sign In to add comment