diff options
| author | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-03-31 09:29:15 +0100 |
|---|---|---|
| committer | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-03-31 09:29:15 +0100 |
| commit | cb54f23a454bc78dd55ddf57b3ced05555466b6e (patch) | |
| tree | 28d559fff7a6e411de874d1b81fe3fb809cc3f09 /challenge-054/simon-proctor | |
| parent | 340592c026f33b33d4334ce5ebd561a35b3c943e (diff) | |
| download | perlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.tar.gz perlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.tar.bz2 perlweeklychallenge-club-cb54f23a454bc78dd55ddf57b3ced05555466b6e.zip | |
Add check the k is in the correct range
Diffstat (limited to 'challenge-054/simon-proctor')
| -rw-r--r-- | challenge-054/simon-proctor/raku/ch-1.p6 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-054/simon-proctor/raku/ch-1.p6 b/challenge-054/simon-proctor/raku/ch-1.p6 index 3670fe4fda..54ef95fd78 100644 --- a/challenge-054/simon-proctor/raku/ch-1.p6 +++ b/challenge-054/simon-proctor/raku/ch-1.p6 @@ -3,6 +3,6 @@ use v6; #| Print the kth permutation of the numbers from 1 to n -sub MAIN( UInt \n, Int \k where * >= 1 ) { +sub MAIN( UInt \n, Int \k where { 1 <= k <= [*] 1..n } ) { (1..n).permutations[k-1].join("").say; } |
