Description

Given a string date in the format YYYY-MM-DD, return the day number of the year. For example, "2019-01-09" is the 9th day of the year.

Examples

Input:date = "2019-01-09"
Output:9
Explanation:

9th day of 2019.

Input:date = "2019-02-10"
Output:41
Explanation:

January has 31 days, so February 10 is day 31 + 10 = 41.

Input:date = "2003-03-01"
Output:60
Explanation:

January has 31 days and February 2003 (non-leap year) has 28 days, so March 1 is day 31 + 28 + 1 = 60.

Constraints

  • date is valid Gregorian calendar date

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!