Day 4: Passport Processing¶
Functions:
|
Split the text on a blank line. |
|
Parse the passport entries separated by a blank-line in |
|
Verify whether the passport entry is valid. |
|
Count the number of valid passports in the |
- blank_line_split(text: str) List[str] [source]¶
Split the text on a blank line.
>>> blank_line_split('X\nY\n\nZ') ['X\nY', 'Z']
- Ensures
len(result) == text.count("nn") + 1
- parse_passport_entries(text: str) List[Tuple[str, str]] [source]¶
Parse the passport entries separated by a blank-line in
text
.- Requires
PASSPORT_RE.fullmatch(text)