private int[,] GetDisk(string input) { var knotHash = new KnotHash(); var disk = new int[130, 130]; int i = 1; foreach (var line in Enumerable.Range(0, 128).Select(q => GetBinary(knotHash.GetHash($"{input}-{q}")))) { int j = 1; foreach (var c in line) { disk[i, j] = int.Parse(c.ToString()); j++; } i++; } return(disk); }
protected override string RunInternalPart1(string input) { var knotHash = new KnotHash(); return(Enumerable.Range(0, 128).Select(i => GetBinary(knotHash.GetHash($"{input}-{i}"))).SelectMany(c => c).Count(c => c == '1').ToString()); }