Skip to content

Instantly share code, notes, and snippets.

@adrianshum
Created November 15, 2023 01:33
Show Gist options
  • Select an option

  • Save adrianshum/f8959691df9bf727fddc6dd32502552f to your computer and use it in GitHub Desktop.

Select an option

Save adrianshum/f8959691df9bf727fddc6dd32502552f to your computer and use it in GitHub Desktop.
py challenge
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