diff --git a/Algorithms/Array/moveZero.hs b/Algorithms/Array/moveZero.hs new file mode 100644 index 000000000..a11fdd907 --- /dev/null +++ b/Algorithms/Array/moveZero.hs @@ -0,0 +1,4 @@ +moveZero :: [Int] -> [Int] +moveZero arr = filter (/= 0) arr ++ filter (== 0) arr + +main = print $ moveZero [1,3,0,6,0,3,0,0]