Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
Do you have the big long string of text? You've got me hooked and I want to solve it, but it seems like it would be more fun to actually get the secret word at the end :)
Not sure why, but my paste of the long string in this comment did not come in correctly as was mentioned below. You can find it on repl.it at repl.it/MivX.
Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
Your solution in Ruby is awesome. I also love the dedication to benchmarking your two different variations and very interesting results on .count and it's optimization. I didn't know that before. Overall, Ruby is just plain awesome.
Ryan is an engineer in the Sacramento Area with a focus in Python, Ruby, and Rust. Bash/Python Exercism mentor. Coding, physics, calculus, music, woodworking. Looking for work!
Running against the blob above it seems the answer is a word followed by some misc character (the last 4 almost spelling out an f-bomb). Did I get the right answer or is something off? I did a codepen with your code and it seems to give the same answer.
For those interested, I put this up on repl.it. I'm not sure why but my paste in the comment above of the very long string did not paste correctly. The repl.it has the correct long string: repl.it/MivX
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Do you have the big long string of text? You've got me hooked and I want to solve it, but it seems like it would be more fun to actually get the secret word at the end :)
Hey Ryan,
Not sure why, but my paste of the long string in this comment did not come in correctly as was mentioned below. You can find it on repl.it at repl.it/MivX.
Enjoy! :)
Ben
Victory! I found an interesting performance quirk, at least for Ruby. Thanks for a great puzzle and write-up!
Your solution in Ruby is awesome. I also love the dedication to benchmarking your two different variations and very interesting results on
.count
and it's optimization. I didn't know that before. Overall, Ruby is just plain awesome.Thanks! Yeah, I was super sure the way you did it would be faster. Ruby is one of my favorite things!
Running against the blob above it seems the answer is a word followed by some misc character (the last 4 almost spelling out an f-bomb). Did I get the right answer or is something off? I did a codepen with your code and it seems to give the same answer.
For those interested, I put this up on repl.it. I'm not sure why but my paste in the comment above of the very long string did not paste correctly. The repl.it has the correct long string: repl.it/MivX