Skip to content

Instantly share code, notes, and snippets.

@phondanai
Created December 3, 2020 08:39
Show Gist options
  • Save phondanai/dd1ecc98f521ef5a4f719b1ab9a12d42 to your computer and use it in GitHub Desktop.
Save phondanai/dd1ecc98f521ef5a4f719b1ab9a12d42 to your computer and use it in GitHub Desktop.
(move-zeros [1 0 0 2 0 3 0 4 5 0 6]) --> (1 2 3 4 5 6 0 0 0 0 0)
(def my-vec [1 0 0 2 0 3 0 4 5 0 6])
(concat (filter #(not= 0 %) my-vec
(filter zero? my-vec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment