File tree 1 file changed +39
-0
lines changed
1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### 1154. Day of the Year
2
+
3
+
4
+ ### Problem Statement
5
+ Given a string date representing a Gregorian calendar date formatted as YYYY-MM-DD, return the day number of the year.
6
+
7
+
8
+
9
+ ### Example 1:
10
+ ```
11
+ Input: date = "2019-01-09"
12
+ Output: 9
13
+ ```
14
+
15
+ ** Explanation** : ``` Given date is the 9th day of the year in 2019. ```
16
+
17
+ ### Example 2:
18
+ ```
19
+ Input: date = "2019-02-10"
20
+ Output: 41
21
+ ```
22
+
23
+ ### Example 3:
24
+ ```
25
+ Input: date = "2003-03-01"
26
+ Output: 60
27
+ ```
28
+
29
+ ### Example 4:
30
+ ```
31
+ Input: date = "2004-03-01"
32
+ Output: 61
33
+ ```
34
+
35
+ ### Constraints:
36
+
37
+ * date.length == 10
38
+ * date[ 4] == date[ 7] == '-', and all other date[ i] 's are digits
39
+ * date represents a calendar date between Jan 1st, 1900 and Dec 31, 2019.
You can’t perform that action at this time.
0 commit comments