RosettaCodeData/Task/McNuggets-problem/Perl/mcnuggets-problem-2.pl
2023-07-01 13:44:08 -04:00

6 lines
153 B
Perl

use strict;
use warnings;
$_ = 1 . 0 x 100;
1 while s/ (?=1) (?:.{6}|.{9}|.{20}) \K 0 /1/x;
/01*$/ and print "Maximum non-Mcnugget number is: $-[0]\n";