From d5c84ed05f7d37a00dbb6a9b48dd598511e9dc50 Mon Sep 17 00:00:00 2001 From: Bob Lied Date: Mon, 18 Sep 2023 10:09:33 -0500 Subject: Week 235 Task 1 solution --- challenge-235/bob-lied/perl/ch-1.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/challenge-235/bob-lied/perl/ch-1.pl b/challenge-235/bob-lied/perl/ch-1.pl index 10b33b72be..06ce8fe5cf 100644 --- a/challenge-235/bob-lied/perl/ch-1.pl +++ b/challenge-235/bob-lied/perl/ch-1.pl @@ -39,12 +39,13 @@ sub removeOne(@ints) return $rmvCount < 2; } -# Map each pair to true/false for being sorteed ascending. Count the falses. +# Map each pair to true/false for being sorted ascending. Count the falses. # Will be inefficient if the list is long and the out-of-order elements are # near the front. sub ro_A(@ints) { - my $rmvCount = grep { $_ == false } map { $ints[$_] < $ints[$_+1] } 0 .. ( $#ints-1 ); + my $rmvCount = grep { $_ == false } + map { $ints[$_] < $ints[$_+1] } 0 .. ( $#ints-1 ); return $rmvCount < 2; } -- cgit