Exemple #1
0
 public new static PassportV2 Parse(string passportInfo)
 => new PassportV2(Passport.Parse(passportInfo).Info);
Exemple #2
0
            /// <summary>
            /// Count invalid passports within a text input.
            /// </summary>
            /// <param name="passports">Double newline separated passports.</param>
            /// <returns>Count of valid passports.</returns>
            public static int Solve(string passports)
            {
                var passportsArray = passports.Split(Environment.NewLine + Environment.NewLine);

                return(passportsArray.Count(p => Passport.Parse(p).IsValid()));
            }