I just finished the Small Common Multiple challenge, but I don’t think my choice of algorithm was the best. I’d like to know how others approached this one.
I’ve been doing a lot of study into functional programming recently and I decided that I wanted to try to solve this one with a purely functional approach. To this end, the table method listed here seemed like a good choice, but it hasn’t worked out so well.
I’ve passed the test, the code works, but that seems to be a dreadfully ineffecient algorithm. I’d like to know how other people approached this problem and what algorithm they choose. Did you run into the same problems, or is there a better way of solving this one?