diff --git a/1/frequency.py~ b/1/frequency.py~ deleted file mode 100755 index 5b33208..0000000 --- a/1/frequency.py~ +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -def delta_frequency(f = sys.stdin): - df = 0 - for l in f.readlines(): - df += int(l) - print(df) - -if __name__ == '__main__': - delta_frequency() diff --git a/2/checksum.py~ b/2/checksum.py~ deleted file mode 100755 index cd9a4cc..0000000 --- a/2/checksum.py~ +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 - -def checksum(l): - double = 0 - triple = 0 - for item in l: - d, t = count_duplicate(item) - double += d - triple += t - return double * triple - -def count_duplicate(item): - double = 0 - triple = 0 - c = dict() - for i in item: - if i in c: - c[i] += 1 - else: - c[i] = 1 - for k,v in c.items(): - if v == 2: - double =11 - if v == 3: - triple = 1 - return (double, triple) - -if __name__ == '__main__': - l = sys.stdin.readlines() - print(checksum(l))