day4
This commit is contained in:
parent
09768918b2
commit
f44cb5def9
13
2015/04/coins.pl
Normal file
13
2015/04/coins.pl
Normal file
@ -0,0 +1,13 @@
|
||||
use 5.20.0;
|
||||
|
||||
my $s = shift;
|
||||
|
||||
use Digest::MD5 qw/ md5_hex /;
|
||||
|
||||
my $i = 0;
|
||||
|
||||
$i++ until md5_hex( $s . $i ) =~ /^0{5}/;
|
||||
|
||||
say $i;
|
||||
|
||||
|
13
2015/04/coins2.pl
Normal file
13
2015/04/coins2.pl
Normal file
@ -0,0 +1,13 @@
|
||||
use 5.20.0;
|
||||
|
||||
my $s = shift;
|
||||
|
||||
use Digest::MD5 qw/ md5_hex /;
|
||||
|
||||
my $i = 0;
|
||||
|
||||
$i++ until md5_hex( $s . $i ) =~ /^0{6}/;
|
||||
|
||||
say $i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user