Files
2020/Extensions.cs
Parnic 03e9408502 Day 22 refactor - 2-3x speedup from changing infinite lookup method
This new method fixes the hands-seen-before check to be actually correct

Unsure how I got the correct answers with that being wrong. 🤷
2020-12-22 09:37:50 -06:00

19 lines
339 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _2020
{
public static class Extensions
{
public static T PopFront<T>(this ICollection<T> list)
{
T val = list.First();
list.Remove(val);
return val;
}
}
}