Created
November 15, 2023 01:33
-
-
Save adrianshum/f8959691df9bf727fddc6dd32502552f to your computer and use it in GitHub Desktop.
py challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| max_days = {} | |
| for d in list2: # or list1, works the same | |
| day, month = int(d[:2]), d[2:] | |
| if month not in max_days or day > max_days[month]: | |
| max_days[month] = day | |
| result = [f"{value:02}{key}" for key,value in max_days.items()] | |
| print(f">>> {result}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment