leap
This commit is contained in:
7
leap/src/leap.gleam
Normal file
7
leap/src/leap.gleam
Normal file
@@ -0,0 +1,7 @@
|
||||
pub fn is_leap_year(year: Int) -> Bool {
|
||||
let divisible_by_4 = year % 4 == 0
|
||||
let divisible_by_100 = year % 100 == 0
|
||||
let divisible_by_400 = year % 400 == 0
|
||||
|
||||
{ divisible_by_4 && !divisible_by_100 } || divisible_by_400
|
||||
}
|
||||
Reference in New Issue
Block a user