mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-25 02:01:56 +01:00
24 lines
428 B
C#
24 lines
428 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
public class Remover
|
|
{
|
|
public static List<int> RemoveSmallest(List<int> numbers)
|
|
{
|
|
if (numbers.Count == 0) return numbers;
|
|
|
|
List<int> new_numbers = new List<int>(numbers);
|
|
|
|
int lowest = new_numbers[0];
|
|
|
|
foreach (int e in numbers)
|
|
{
|
|
if (e < lowest) lowest = e;
|
|
}
|
|
|
|
new_numbers.Remove(lowest);
|
|
|
|
return new_numbers;
|
|
}
|
|
}
|