diff options
| author | Niels van Dijke <perlboy@cpan.org> | 2025-05-19 07:50:07 +0000 |
|---|---|---|
| committer | Niels van Dijke <perlboy@cpan.org> | 2025-05-19 07:50:07 +0000 |
| commit | aba6b7ef791aa95ffe5fea741a6e49aa970fd633 (patch) | |
| tree | 2e106cc50ff146a490212ea23e30a444f8080408 | |
| parent | 0af1650632b5c41634fddec6d29bf87731adc85e (diff) | |
| download | perlweeklychallenge-club-aba6b7ef791aa95ffe5fea741a6e49aa970fd633.tar.gz perlweeklychallenge-club-aba6b7ef791aa95ffe5fea741a6e49aa970fd633.tar.bz2 perlweeklychallenge-club-aba6b7ef791aa95ffe5fea741a6e49aa970fd633.zip | |
Task 2 - add "<=>" sorting
| -rwxr-xr-x | challenge-322/perlboy1967/perl/ch2.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-322/perlboy1967/perl/ch2.pl b/challenge-322/perlboy1967/perl/ch2.pl index 5c24353d26..5e46d4cf12 100755 --- a/challenge-322/perlboy1967/perl/ch2.pl +++ b/challenge-322/perlboy1967/perl/ch2.pl @@ -28,7 +28,7 @@ use List::MoreUtils qw(uniq); sub rankArray (@ints) { my ($i,%idx) = (1); - $idx{$_} = $i++ for uniq sort @ints; + $idx{$_} = $i++ for uniq sort { $a <=> $b } @ints; return map { $idx{$_} } @ints; } |
