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. 🤷
This commit is contained in:
2020-12-22 08:45:47 -06:00
parent 1b0e401e03
commit 03e9408502
2 changed files with 83 additions and 74 deletions

18
Extensions.cs Normal file
View File

@ -0,0 +1,18 @@
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;
}
}
}