Sha256: b5d10e52cfb75bf7b858d65c3fcad72e246069336fc93edba4205cf603b3a7b1

Contents?: true

Size: 326 Bytes

Versions: 47

Compression:

Stored size: 326 Bytes

Contents

# Declare package 'Leap' with version
package Leap 3;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT_OK = qw(is_leap);

sub is_leap {
  my $year = shift;
  divisible_by($year, 400)
    or divisible_by($year, 4) and !divisible_by($year, 100)
    ? 1 : 0;
}

sub divisible_by {
  $_[0] % $_[1] == 0 ? 1 : 0;
}

1;

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
trackler-2.2.1.138 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.137 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.136 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.135 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.134 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.133 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm
trackler-2.2.1.132 tracks/perl5/exercises/leap/.meta/solutions/Leap.pm