private static string SolveGold(string input) { var keyPad = new KeyPad(5, 5, new [] { ' ', ' ', '1', ' ', ' ', ' ', '2', '3', '4', ' ', '5', '6', '7', '8', '9', ' ', 'A', 'B', 'C', ' ', ' ', ' ', 'D', ' ', ' ' }); var code = Solve(keyPad, input); return($"Stupid keypad, but the code is: {code}"); }
private static string Solve(KeyPad keyPad, string secretDocument) { var finger = new Finger(keyPad, secretDocument); return(string.Concat(finger.GetKeyPresses('5'))); }
public Finger(KeyPad keyPad, string procedure) { _keyPad = keyPad; _instructions = Memorize(procedure); }