Created
December 4, 2017 12:26
-
-
Save 4Kaylum/e1d2908fbb4e5672e09e928bfcb7e206 to your computer and use it in GitHub Desktop.
This file contains 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
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