in reply to Re: One for the weekend: challenge
in thread One for the weekend: challenge

This produces correct output quite efficiently.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: One for the weekend: challenge
by sparkylu (Monk) on Jun 03, 2008 at 10:50 UTC
    So which solution matched up to your expectations the best? I haven't tried all of them yet... waiting for my next break.
Re^3: One for the weekend: challenge
by Limbic~Region (Chancellor) on Jun 03, 2008 at 18:22 UTC
    BrowserUk,
    Here is the same code re-written to be more clear and maintainable. I still think the handful of special case scenarios could be reduced to a more general case. Unfortunately, I don't have time to try.

    Cheers - L~R