Oh man! What a doozie. Here was the problem: Word Mesh.
This was a little bit of algorithm hell, but I found my way very quickly through the actual coding process with only a few hiccups after figuring out the algorithm. It’s not readable at all or pretty, but it worked.
Launch School teaches us to focus on solving the problem via the algorithm first, which then makes the actual coding part of the problem much easier. You have your path already mapped out in front of you. As long as you test little bits of the growing code along the way to make sure it’s working, there shouldn’t be many surprises.
I still am not happy with my final version from today, but tomorrow I am going to study the other one-liner answers and see if I can figure out how to reverse engineer them.
The other LS student who answered this problem found all the substrings, which is also an intriguing idea that I really want to think through now. I see that a lot of people did something similar in their one-liners, but of course this student’s answer is much more readable.