]> www.fi.muni.cz Git - aoc.git/blob - 2019/07.pl
Day 25: examining the input
[aoc.git] / 2019 / 07.pl
1 #!/usr/bin/perl -w
2
3 use v5.16;
4
5 my $count;
6 NUM:
7 for (347312..805915) {
8         next if !/(.)\1/;
9         my $prev = 0;
10         for my $d (split //) {
11                 next NUM if $d < $prev;
12                 $prev = $d;
13         }
14         $count++;
15 }
16
17 say $count;
18