Quest 7: Namegraph
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
Link to participate: https://everybody.codes/
6 Comments
janAkali@lemmy.sdf.org · 2 pts · 268d
Nim
Part 3 is a recursive solution with caching (memoization).
Full solution at Codeberg: solution.nim
vole@lemmy.world · 2 pts · 264d
Scheme/Guile
You could probably build a (letter, length) => combination-count mapping pretty quickly for part 3, but dealing with overlap in the input elements seems like a pain if handled this way.
Pyro@programming.dev · 2 pts · 257d
Python
hades@programming.dev · 2 pts · 269d
Rust
Technically you don't need to store the names in part 3, but I was too lazy.
mykl@lemmy.world · 2 pts · 267d
Uiua
There's probably a good solution hiding in here, but this ain't it. I originally went for the combinatoric approach for part 3, but it was giving me an answer that turned out to be out by 8, so brute force came to the rescue.
lwhjp@piefed.blahaj.zone · 1 pts · 269d
lwhjp@piefed.blahaj.zone · 1 pts · 269d
Haskell
A nice dynamic programming problem in part 3.