1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-25 02:01:56 +01:00
CodeWars/7kyu/remove_the_minimum/solution.cs

25 lines
428 B
C#
Raw Normal View History

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