In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 50. And this is Euler Problem 50. I did it — I met my goal of completely the first 50 Euler Problems in Ruby by tomorrow, August 18. This was a fun problem which I did entirely on paper, in [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 49. Here, you will find that I took advantage of Ruby’s Prime Class and the Array.permutations method yet again. I think the solution is straight-forward and easy to read — unlike the problem description which I didn’t find very clear [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 48. I challenged myself to complete the first 50 Euler Problems in Ruby by tomorrow. Having such an easy problem show up this late in the game gave me great hope that I’d meet my goal. Coming up with this [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 47. This solution shows off the power of built-in Ruby Array methods. You will notice Array.uniq returns a new array by removing duplicate values in self and Array.transpose, which I haven’t used prior to this solution, assumes that self is [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 46. I could be wrong, but I don’t see any exciting and new Ruby stuff going on here. The prime class continues to come in handy and I’m extending the integer class, but that’s about it. As always, any feedback [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 45. After the last problem, I figure to heck with trying to optimize. Below you’ll find another brute force solution which completes in less than a second. The trick was finding the intersection of the three arrays which is a [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 44. So much for my brute-force-only-just-get-the-answer-in-less-than-one-minute approach. I worked through this problem four different ways — each time holding x number of pentagonal numbers in a various data structure for quick comparison. That was a bad move as each attempt [...]
In my attempt to learn Ruby out in the open, here’s my solution for Project Euler Problem 43. This is yet another problem where I blatantly avoided all real math. (Maybe that’s why it takes 37 seconds to execute…) I found this problem interesting, pun intended. Not much going on here, but I am starting to dig [...]