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
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
153f02a831
feat(input): implement parsing from ws-separated string
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 11:00:45 +01:00
142dccf8f1
fix: move the testing macro out
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 10:59:51 +01:00
8757b394d1
fix(tests): don't be too repetitive about test_
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 10:58:28 +01:00
b31e46487a
feat(input): make parsing functions generic
...
Make parsing functions generic with regards to the containers they
return.
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 10:57:50 +01:00
19604eafb2
day(04): add solution
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-04 10:35:34 +01:00
45b6f64a3e
day(03): refactor the solution
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-03 13:13:55 +01:00
ea6275d9e5
day(03): add solution
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-03 13:13:54 +01:00
673c9299d5
day(01): format
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-03 13:13:23 +01:00
b0554f5cf4
day(02): add solution
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-02 19:21:03 +01:00
b87e0ac219
day(01): add solution
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-02 19:20:52 +01:00
c692f1f510
feat: allow different samples within one day
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-02 19:05:11 +01:00
3afb870cf1
chore: initialize with '22 template
...
Signed-off-by: Matej Focko <mfocko@redhat.com>
2023-12-02 18:46:37 +01:00