From 4221056afa7ce74e354cab181df7d026c00fc037 Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 16 Nov 2021 14:45:14 +0000 Subject: Update README.md --- challenge-139/james-smith/README.md | 3 +-- 1 file changed, 1 insertion(+), 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; } ``` -- cgit