diff --git a/2015/17.py b/2015/17.py index 92c614f..fda8961 100644 --- a/2015/17.py +++ b/2015/17.py @@ -1,43 +1,42 @@ # Fill Input -input = "" - try: with open("17.txt", 'r', encoding='utf-8') as file: - input += file.read() + input = file.read() except Exception as e: print(f"An error occurred: {e}") -# Check if sum of permutation equal 150 -def sum_equal_150(input, i): - sum = 0 - for j in range(l): - if i & 1< 150: - return False - return sum == 150 - # Reverse sort input input= [ int(x) for x in input.split()] -input.sort(reverse=True) - l = len(input) + res1, res2, min_popcount = 0, 0, l +for i in range(1< [input[j] for j in range(len(X)) if i & 1<