Talentd/FleetCode/Problems/

1118. Number of Days in a Month

Easy
Read SolutionWatch Video

1118. Number of Days in a Month

Easy59.4% AcceptancePremium
PremiumFree on FleetCode

Given a year year and a month month, return the number of days of that month.

Example 1:

Input: year = 1992, month = 7
Output: 31

Example 2:

Input: year = 2000, month = 2
Output: 29

Example 3:

Input: year = 1900, month = 2
Output: 28

Constraints:

  • 1583 <= year <= 2100
  • 1 <= month <= 12
Asked by 1 company

Loading editor...

1992
7