public void FirstStarExample() { (int firstCycleCount, int count) = DebuggerMemory.CountRedistsToSame(new[] { 0, 2, 7, 0 }); Assert.Equal(5, firstCycleCount); Assert.Equal(4, count); }
public override string SecondStar() { var input = ReadInput(); int[] slots = Regex.Replace(input, @"\s+", " ").Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray(); (_, int count) = DebuggerMemory.CountRedistsToSame(slots); return(count.ToString()); }