LeetCode --- 1154. Day of the Year 解题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1154. Day of the Year 解题报告相关的知识,希望对你有一定的参考价值。
Given a string date
representing a Gregorian calendar date formatted as YYYY-MM-DD
, return the day number of the year.
Example 1:
Input: date = "2019-01-09" Output: 9 Explanation: Given date is the 9th day of the year in 2019.
Example 2:
Input: date = "2019-02-10" Output: 41
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 31th, 2019.
所有代码均可在Github中找到:
以上是关于LeetCode --- 1154. Day of the Year 解题报告的主要内容,如果未能解决你的问题,请参考以下文章
Leetcode-1154 Ordinal Number Of Date(一年中的第几天)
LeetCode --- 1185. Day of the Week 解题报告
LeetCode --- 1185. Day of the Week 解题报告