aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-139/james-smith/README.md3
1 files changed, 1 insertions, 2 deletions
diff --git a/challenge-139/james-smith/README.md b/challenge-139/james-smith/README.md
index 9daa5abd0d..997f3d064b 100644
--- a/challenge-139/james-smith/README.md
+++ b/challenge-139/james-smith/README.md
@@ -78,8 +78,7 @@ This gives us the function below to get the length of the recurring sequence.
sub rec_len {
my( $D, $N, $s ) = ( shift, 1, '' );
( $s, $N ) = ( $s.int($N/$D), ($N%$D).0 ) for 0 .. 2*$D;
- $s =~ m{(\d+?)\1+$};
- length $1;
+ $s =~ /(\d+?)\1+$/ ? length $1 : 0;
}
```