Day Of The Year, is a LeetCode problem. In this post we will see how we can solve this challenge in C++

Problem Description

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

Example 3:

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

Example 4:

Input: date = "2004-03-01" Output: 61

Constraints:

date.length == 10

....

You can find the full details of the problem Day of the Year at LeetCode

Solution: Please check the main.cpp snippet for the solution.

This solution originally posted at: Github by @kamyu104