题目描述
Given a date, the task is to check if it is valid or not. It may be assumed that the given date is in range from 01/01/1800 to 31/12/9999 and any date not within this range will also be considered invalid.
Example 1:
Input:
d = 10, m = 12, y = 2000
Output:
1
Explanation:
The given date 10/12/2000 is valid.
Example 2:
Input:
d = 30, m = 2, y = 1700
Output:
0
Explanation:
The given date 30/2/1700 is invalid.
Your Task:
You don't need to read input or print anything. Your task is to complete the function isValidDate() which takes 3 Integers d,m and y as input and returns the answer.
Expected Time Complexity: O(1)
Expected Auxiliary Space: O(1)
Constraints:
1 <= d, m, y <= 10000
输入格式
见题面
输出格式
见题面
样例输入
d = 10, m = 12, y = 2000
样例输出
1