day5
This commit is contained in:
parent
8adf1fa6e3
commit
67ba17edba
10
2015/05/nice.pl
Normal file
10
2015/05/nice.pl
Normal file
@ -0,0 +1,10 @@
|
||||
use 5.20.0;
|
||||
use List::AllUtils qw/ sum /;
|
||||
|
||||
say sum map { nice() }<>;
|
||||
|
||||
sub nice {
|
||||
return 0 if /ab|cd|pq|xy/ or not /(.)\1/;
|
||||
my @x = /([aeiou])/g;
|
||||
@x >= 3;
|
||||
}
|
8
2015/05/nice2.pl
Normal file
8
2015/05/nice2.pl
Normal file
@ -0,0 +1,8 @@
|
||||
use 5.20.0;
|
||||
use List::AllUtils qw/ sum /;
|
||||
|
||||
say sum map { nice() }<>;
|
||||
|
||||
sub nice {
|
||||
return !!( /(..).*?\1/ and /(.).\1/ );
|
||||
}
|
Loading…
Reference in New Issue
Block a user