1001. Check if Given Year is a Leap Year

Given an integer year, determine whether it is a leap year. Return "Yes" if it is a leap year, otherwise return "No".

Example 1:

Input: 1996

Output: Yes

Explanation: 1996 is divisible by 4 and not by 100, so it's a leap year.

Example 2:

Input: 2000

Output: Yes

Explanation: 2000 is divisible by 400, so it's a leap year.

Now Your Turn!

Pick the correct output for the given input

Input: 1900

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • 1 <= year <= 109
0
class Solution {
public:
string isLeapYear(int year) {
// Your code goes here
}
};
Test Case

Input:

Year