mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-22 16:43:46 +01:00
14 lines
315 B
C#
14 lines
315 B
C#
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
|
||
|
public class Kata {
|
||
|
public static int[] MoveZeroes(int[] arr) {
|
||
|
var length = arr.GetLength(0);
|
||
|
|
||
|
var new_arr = arr.Where(x => x != 0).ToList();
|
||
|
for (var i = length - new_arr.Count(); i > 0; i--) new_arr.Add(0);
|
||
|
|
||
|
return new_arr.ToArray();
|
||
|
}
|
||
|
}
|