1154. Day of the Year
https://leetcode.com/problems/day-of-the-year
Description
Given a string date
representing a Gregorian calendar date formatted as YYYY-MM-DD
, return the day number of the year.
Example 1:
Example 2:
Example 3:
Example 4:
Constraints:
date.length == 10
date[4] == date[7] == '-'
, and all otherdate[i]
's are digitsdate
represents a calendar date between Jan 1st, 1900 and Dec 31, 2019.
ac
Last updated