1
1
Fork 0
exercism/jq/leap/leap.jq
Christina Sørensen 1e351d9c3e
feat(jq): two-fer, resistor-color, resistor-color-duo, leap, isogram, flatten-array
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-12-16 08:26:51 +01:00

7 lines
331 B
Text

#- In every year that is evenly divisible by 4.
#- Unless the year is evenly divisible by 100, in which case it's only a leap year if the year is also evenly divisible by 400.
.year|tonumber|
if . % 100 == 0 and . % 400 == 0 then true
elif . % 100 != 0 and . % 4 == 0 then true
else false
end