Here is my Rust version! These are getting long including the tests, so I might have to find a better way to post em here! Maybe I'll start posting embeds to their Github repo š¤ (But I don't know if I can embed a single file from a repo...)
Anyways here is today's!
I took a optimization, by never actually calculating the full factorial. Instead I do the prime decomposition, on each of the factorial values (2..n) and append those lists of prime numbers together. This list will be the same as a prime decomposition of the full factorial.
From here I count the occurrences of each of the prime numbers and the format a string matching the examples!
Here is my Rust version! These are getting long including the tests, so I might have to find a better way to post em here! Maybe I'll start posting embeds to their Github repo š¤ (But I don't know if I can embed a single file from a repo...)
Anyways here is today's!
I took a optimization, by never actually calculating the full factorial. Instead I do the prime decomposition, on each of the factorial values (2..n) and append those lists of prime numbers together. This list will be the same as a prime decomposition of the full factorial.
From here I count the occurrences of each of the prime numbers and the format a string matching the examples!