> A half hour? Sasha, you're loosing your touch!
People are often unhappy when I tell them how long it would take me to code
something up. However, I do have a pretty good record of delivering on time.
> Here's a quicky PHP version:
> (note: it does no input validation--non or empty array will probably break it)
It fails if your array has duplicates. Aside from that, think about the plight
of having to port it to C (something you would want to do for a O(N!)
algorithm). Also, what if your array had objects instead of strings?
The "inspirational" part of a solution is usually about only 10% of the work.
The rest is debugging, testing, error checking, and other forms of necessary
tedium.
Perhaps half-hour was an optimisitic estimate after all...
--
Sasha Pachev
AskSasha Linux Consulting
http://www.asksasha.com
.===================================.
| This has been a P.L.U.G. mailing. |
| Don't Fear the Penguin. |
| IRC: #utah at irc.freenode.net |
`==================================='