From 62bdc3c593d244d3b5a02ccf874f510271200efd Mon Sep 17 00:00:00 2001 From: PedroEdiaz Date: Fri, 31 Oct 2025 15:57:08 -0600 Subject: [PATCH] Opt: 01, 17 --- 2015/01.py | 4 ++-- 2015/17.py | 45 +++++++++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/2015/01.py b/2015/01.py index 617c37d..8828dd9 100644 --- a/2015/01.py +++ b/2015/01.py @@ -12,8 +12,8 @@ except Exception as e: res1, res2 = 0, 0 -for i in range(len(input)): - match input[i]: +for c in input: + match c case '(': res1 += 1 case ')': diff --git a/2015/17.py b/2015/17.py index fda8961..68b0ceb 100644 --- a/2015/17.py +++ b/2015/17.py @@ -7,36 +7,41 @@ except Exception as e: print(f"An error occurred: {e}") # Reverse sort input + +""" +Let: + f: i -> X[j] for j in range(len(X)) if i & 1< [input[j] for j in range(len(X)) if i & 1<