def task xs Array Int val minimum xs min val num xs length xs filter m

1
2
3
4
5
def task(xs: Array[Int]) = {
val minimum = xs.min
val num = xs.length - xs.filter(x => x != minimum).length
Array.fill(num)(minimum) ++ xs.filter(x => x != minimum)
}