Created
December 3, 2020 08:39
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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