Sha256: 5e848b504d96772ca9a0f031875efc72e792d79c7d4f7559141424fb33cf3ff6

Contents?: true

Size: 331 Bytes

Versions: 69

Compression:

Stored size: 331 Bytes

Contents

defmodule Year do
  def leap_year?(year) do
    div4?(year) && div100?(year) == div400?(year)
  end

  defp divides?(dividend, divisor), do: rem(dividend, divisor) == 0
  defp div4?(dividend), do: divides?(dividend, 4)
  defp div100?(dividend), do: divides?(dividend, 100)
  defp div400?(dividend), do: divides?(dividend, 400)
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.179 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.178 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.177 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.176 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.175 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.174 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.173 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.172 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.171 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.170 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.169 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.167 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.166 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.165 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.164 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.163 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.162 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.161 tracks/elixir/exercises/leap/example.exs
trackler-2.2.1.160 tracks/elixir/exercises/leap/example.exs