1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 11:09:07 +01:00
CodeWars/7kyu/remove_the_minimum/solution.cs
Matej Focko fc899b0b02
chore: initial commit
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 16:19:58 +01:00

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;
}
}