As you probably know an astronomical year is slightly less than 365 days (roughly 365.2425 days). For that reason the Gregorian calendar got common years (365 days each) and leap years.
You task is to write a function that detects whether a given year is a leap year (according to the Gregorian calendar). Feel free to test it, e.g. on the following input: [1792, 1859, 1900, 1918, 1974, 1985, 2000, 2012] of which only 1792, 2000, and 2012 are leap years.