- or download this
use strict;
use warnings;
...
map { $_ % 2 ? ( $high --, $low ++) : ( $low ++, $high --) }
1 .. $length / 2;
}
- or download this
hog ace big gog fig cat dog egg
- or download this
sub reOrder
{
...
1 .. $length / 2;
return @slice, $low == $high ? $low : ();
}