We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c672b38 commit 3bca302Copy full SHA for 3bca302
leap_year.py
@@ -0,0 +1,13 @@
1
+class Solution:
2
+ """
3
+ @param n: a number represent year
4
+ @return: whether year n is a leap year.
5
6
+ def isLeapYear(self, n):
7
+ # write your code here
8
+ if n % 400 == 0:
9
+ return True
10
+ else:
11
+ return (n % 4 == 0) and (n % 100 != 0)
12
+
13
+# easy: https://www.lintcode.com/problem/leap-year
0 commit comments