I suggest you read each line of code and decide what it is for. Follow the logic, and see if it makes sense.
I was going to offer a more elegant (and working) solution, but it turns out that your specification is incomplete, and partially contradicts the code you demonstrated. So until that's straightened out, I'm a little hesitant to demonstrate a solution that might be misinterpreting what you're trying to accomplish.
Dave
In reply to Re: Sorting challenge
by davido
in thread Sorting challenge
by PerlSufi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |