private static void Main(string[] args) { var result1 = Puzzle02.CountValidPolicy1Passwords(PuzzleInput.ToPuzzle2Input()); var result2 = Puzzle02.CountValidPolicy2Passwords(PuzzleInput.ToPuzzle2Input()); Console.WriteLine($"Valid passwords (policy 1): {result1}"); Console.WriteLine($"Valid passwords (policy 2): {result2}"); }
public void PasswordPolicy2Tests() { var stringInput = @"1-3 a: abcde 1-3 b: cdefg 2-9 c: ccccccccc"; var count = Puzzle02.CountValidPolicy2Passwords(stringInput.ToPuzzle2Input()); Assert.Equal(1, count); }