diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-08-14 10:33:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-14 10:33:33 +0100 |
| commit | 7ba825fa35167322bdcd7436fa15b8d2d67515ac (patch) | |
| tree | e8717a2830ea2185e32413cf0efdfb7e5fcc0d45 | |
| parent | cfbe6d2456c2eeb194ddc949abfbaac445b8a559 (diff) | |
| parent | 3238b61e22c87193fbb2a6ed12fd82ffbd7f2f44 (diff) | |
| download | perlweeklychallenge-club-7ba825fa35167322bdcd7436fa15b8d2d67515ac.tar.gz perlweeklychallenge-club-7ba825fa35167322bdcd7436fa15b8d2d67515ac.tar.bz2 perlweeklychallenge-club-7ba825fa35167322bdcd7436fa15b8d2d67515ac.zip | |
Merge pull request #10612 from robbie-hatley/rh282
Corrected pull request (last request got botched somehow).
| -rwxr-xr-x | challenge-282/robbie-hatley/perl/ch-2.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/challenge-282/robbie-hatley/perl/ch-2.pl b/challenge-282/robbie-hatley/perl/ch-2.pl index a21d46f554..d3ae73e8ee 100755 --- a/challenge-282/robbie-hatley/perl/ch-2.pl +++ b/challenge-282/robbie-hatley/perl/ch-2.pl @@ -12,7 +12,7 @@ PROBLEM DESCRIPTION: Task 282-2: Changing Keys Submitted by: Mohammad Sajid Anwar Write a scripts which, given an alphabetic string $str, returns -the number of types a hunt-and-peck typist would have to move +the number of times a hunt-and-peck typist would have to move his right forefinger to a new letter key in order to type the string (not counting usages of shift keys). Example 1: Input: "pPeERrLl" Output: 3 @@ -21,8 +21,8 @@ Example 3: Input: "GoO" Output: 1 -------------------------------------------------------------------------------------------------------------- PROBLEM NOTES: -I'll base the solution to this (and to 282-2) on the concept of "m//g operator in scalar context". -Specifically, in 282-2 I'll check for a two consecutive captured single-character matches (embedded in a +I'll base my solution to this (and also to 282-1) on the concept of "m//g operator in scalar context". +Specifically, in 282-2 I'll check for two consecutive captured single-character matches (embedded in a positive look-ahead to prevent the matches from over-eating), then count the number of times that $1 ne $2. -------------------------------------------------------------------------------------------------------------- |
