From: Ragunathan Pattabiraman Date: 2008-06-20T02:23:18+09:00 Subject: Re: little problem (google hiring puzzle) > IMHO you'd also look at join (iterates over the array) and eval > (parses the string). Eval is IMHO scary in this context because one > (most ruby users or I at least) usually doesn't really know what it > involves. I saw the array#join source which seems to involve a loop. Apparantly this is O(n^2). Not quite sure about eval though. I believe Ruby is about elegance and simplicity. Many of the solutions I saw here were cryptic, at least to me. Stuff from Ruby gurus. I learned some new stuff studying them. But simplicity is the virtue that is missing IMHO. I thought I would attempt at simplicity. But as you pointed out it is not efficient at all. ("It's another Ruby virtue" says Ruby critic!) Thank you all for your inputs. Just wondering... is there any tool which computes the time complexity given the code? That would be cool as we wouldn't want to checkout ruby impl everytime. -- Posted via http://www.ruby-forum.com/.