1
0
Fork 0
Commit graph

63 commits

Author SHA1 Message Date
69287d8a30
fix(vector2d): order first by ‹y› then by ‹x›
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-18 19:21:18 +01:00
2f324acea8
day(18): refactor a bit
Not enough for part 2 though…

Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-18 18:44:41 +01:00
4ce1f28556
day(18): make the guess of dimensions better
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-18 16:26:54 +01:00
aa100460a2
day(18): add part 1
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-18 14:16:58 +01:00
2b1ef62387
chore: ignore VSCode BS
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:30:45 +01:00
07d9b05904
day(17): use ‹From› on ‹MinHeap›
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:26:26 +01:00
12322c9fae
fix(ds): be consistent about required traits
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:25:13 +01:00
3fcbbf4f81
feat(ds): implement ‹From› and ‹FromIterator›
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:25:13 +01:00
4c07bd4f2e
day(17): use product of iterators
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:25:13 +01:00
15fccb9f5e
day(17): add solution
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-17 18:09:44 +01:00
fffaaf0637
day(16): add solution
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-16 22:18:43 +01:00
57d3761793
day(15): add solution
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-16 22:17:25 +01:00
911e1f6342
chore: upgrade
Signed-off-by: Matej Focko <me@mfocko.xyz>
2023-12-16 22:16:27 +01:00
fdbca4409c
day(14): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-14 10:50:35 +01:00
0a4cc4c031
day(13): transpose instead of a copy-paste
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-13 21:47:47 +01:00
b3e7037f33
day(13): take the factor out of helper function
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-13 21:39:29 +01:00
a41963a338
day(12): shift the difference by one
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-13 21:38:54 +01:00
327a2d1df4
day(13): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-13 15:44:50 +01:00
dab87eeb22
day(12): switch back to the ‹Vec›
Stack is enough, we were using just ‹.front()› and ‹.pop_front()› on the
‹VecDeque›.

Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 15:36:19 +01:00
65be0553a6
day(12): remove unused cache
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 15:29:53 +01:00
20de5928c2
day(12): move the mutability into the function
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 15:28:38 +01:00
dc2df6d7fb
day(12): refactor ‹unfold› and test it
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 15:28:07 +01:00
63a41764ec
day(12): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 11:37:31 +01:00
501d8cb515
feat(input): add ‹parse_separated›
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 11:37:15 +01:00
9abfb4d18d
chore: add indicatif and memoize
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-12 11:36:00 +01:00
8e90fd7fe5
day(11): factor out ‹count_within›
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 14:57:51 +01:00
63d495b175
day(11): format the expression
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 11:33:47 +01:00
bcdea3496b
day(11): use iterators instead of the ‹for› loops
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 10:53:30 +01:00
af6cba1445
day(11): use ‹usize›
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 10:51:54 +01:00
09e0d81ffe
day(11): factor out the solution for any factor
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 10:45:21 +01:00
95d451d103
day(11): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-11 10:37:23 +01:00
99cb590d6f
day(10): refactor the part 2
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-10 17:45:24 +01:00
f2829381c8
day(10): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-10 17:15:03 +01:00
4a2e0fef55
day(09): do ‹find_next› in-situ
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-09 13:30:28 +01:00
018ee668d4
day(09): factor out the ‹find_next›
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-09 13:30:28 +01:00
ab9a4bde33
day(09): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-09 13:30:28 +01:00
caa38e535a
feat(math): add ‹gcd› and ‹lcm› to the library
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-09 13:29:39 +01:00
88d06b99ec
day(08): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-08 11:55:22 +01:00
1275d5b738
day(07): use match
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:44:25 +01:00
b582bf33d9
day(07): unify the hand type deduction
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:44:25 +01:00
03e59ecf8f
day(07): don't implement Ord
Makes it easier to implement a function that generates comparator based
on the card ranking and the hand type deduction.

Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:44:25 +01:00
44624770cd
day(07): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:44:25 +01:00
19c94a7c46
day(06): introduce a helper function for filtering
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:43:58 +01:00
cb0f7fa445
day(06): factor out the merging
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:43:58 +01:00
a83cea78b7
day(06): add solution
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:43:57 +01:00
370b00c0c9
fix: disable unused imports in lib
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:43:25 +01:00
0f5e11a79f
day(05): add todo and comment out unused
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-07 10:43:08 +01:00
715904ca2b
day(05): add solution
“brute-force me up inside”

Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-05 08:35:30 +01:00
e58483770f
feat: add template
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 11:01:17 +01:00
a13721bcb5
day(04): use new parsing function
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 11:00:59 +01:00