-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Day of the Year | ||
|
||
LeetCode #: [1154](https://leetcode.com/problems/day-of-the-year/) | ||
|
||
Difficulty: Easy | ||
|
||
Topics: Math. | ||
|
||
## Problem | ||
|
||
Given a string `date` representing a [Gregorian calendar](https://en.wikipedia.org/wiki/Gregorian_calendar) date formatted as `YYYY-MM-DD`, return the day number of the year. | ||
|
||
Example 1: | ||
|
||
```text | ||
Input: date = "2019-01-09" | ||
Output: 9 | ||
Explanation: Given date is the 9th day of the year in 2019. | ||
``` | ||
|
||
Example 2: | ||
|
||
```text | ||
Input: date = "2019-02-10" | ||
Output: 41 | ||
``` | ||
|
||
Example 3: | ||
|
||
```text | ||
Input: date = "2003-03-01" | ||
Output: 60 | ||
``` | ||
|
||
Example 4: | ||
|
||
```text | ||
Input: date = "2004-03-01" | ||
Output: 61 | ||
``` | ||
|
||
Constraints: | ||
|
||
- `date.length == 10` | ||
- `date[4] == date[7] == '-'`, and all other `date[i]`'s are digits | ||
- `date` represents a calendar date between Jan 1st, 1900 and Dec 31, 2019. |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/ordinal-number-of-date/solution.test.js → problems/day-of-the-year/dayOfYear.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.