about summary refs log tree commit diff
path: root/users/sterni/exercises/aoc/2022/01/1.k
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-12-02T01·53+0100
committerclbot <clbot@tvl.fyi>2022-12-02T02·21+0000
commit7ffeb4f7f1657d29df9832460ce6fa33a2184bad (patch)
treec988d4247b83b603f7abe4bfcbd23dbf53da9025 /users/sterni/exercises/aoc/2022/01/1.k
parent7e122fdcbc266677e83290fef9766f761d99cb9e (diff)
refactor(sterni/aoc/2022): use scan in BQN/k r/5365
We can actually use one and the same scan on the sorted list
to solve part 1 and 2 of the assignment.

Change-Id: I657a81bad6151ef4fe13239db88d2dbd2f9c29d8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7491
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/sterni/exercises/aoc/2022/01/1.k')
-rw-r--r--users/sterni/exercises/aoc/2022/01/1.k3
1 files changed, 1 insertions, 2 deletions
diff --git a/users/sterni/exercises/aoc/2022/01/1.k b/users/sterni/exercises/aoc/2022/01/1.k
index 295503905fb8..42d64dfb6cc1 100644
--- a/users/sterni/exercises/aoc/2022/01/1.k
+++ b/users/sterni/exercises/aoc/2022/01/1.k
@@ -1,2 +1 @@
- / a better approach is to use the downgraded list for both tasks, as demonstrated by leah2
-(|/e),+/e@3#>e:(+/.'1_)'(&0=#'i)_i:0:"input"
+(+\e@3#>e:(+/.'1_)'(&0=#'i)_i:0:"input")_1