Skip to content

Instantly share code, notes, and snippets.

@4Kaylum
Created December 4, 2017 12:26
Show Gist options
  • Save 4Kaylum/e1d2908fbb4e5672e09e928bfcb7e206 to your computer and use it in GitHub Desktop.
Save 4Kaylum/e1d2908fbb4e5672e09e928bfcb7e206 to your computer and use it in GitHub Desktop.
def get_checksum(spreadhseet:str) -> int:
spreadhseet = [[int(val) for val in row.split('\t') if val] for row in spreadhseet.split('\n')]
val = 0
for row in spreadhseet:
val += max(row) - min(row)
return val
def get_checksum_part_2(spreadhseet:str) -> int:
spreadhseet = [[int(val) for val in row.split('\t') if val] for row in spreadhseet.split('\n')]
val = 0
for row in spreadhseet:
for item in row:
for item2 in row:
if item % item2 == 0 and item != item2:
val += item / item2
return val
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment