585. Number of Days in a Month
Given a year year and a month month, return the number of days in that month.
Example 1:
Input: year = 2024, month = 1
Output: 31
Example 2:
Input: year = 2023, month = 2
Output: 28
Now Your Turn!
Pick the correct output for the given inputInput: year = 2020, month = 2
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1583 <= year <= 2100
- 1 <= month <= 12