private static Passport[] GetPassports(string[] input) { return(input .GroupByEmptyLine() .Select(raw => { var info = string.Join(" ", raw); var fields = info.Split(" ").Select(x => x.Split(":")).ToDictionary(x => x[0], x => x[1]); return Passport.Create(fields); }) .ToArray()); }