Beispiel #1
0
        public int SolvePart1(string file)
        {
            IList <string> passwords = new List <string>();

            using (var reader = new StreamReader(file))
            {
                while (!reader.EndOfStream)
                {
                    passwords.Add(reader.ReadLine());
                }
            }

            var validator = new PasswordValidator();

            return(passwords.Where(password => validator.Validate(password)).Count());
        }
Beispiel #2
0
 public ChallengeDay4Part1(PasswordValidator passwordValidator)
 {
     _passwordValidator = passwordValidator;
 }