Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn drop-every-nth [seq n]
- (loop [se seq
- nth 1
- curr '()]
- (if (empty? se)
- (reverse curr)
- (if (zero? (mod nth n))
- (recur (rest se) (inc nth) curr)
- (recur (rest se) (inc nth) (conj curr (first se)))))))
Advertisement
Add Comment
Please, Sign In to add comment