Available question text
Parse the YYYY-MM-DD string and compute the ordinal day by summing days in the preceding months and adding the day-of-month, handling leap years (year divisible by 4 but not 100 unless divisible by 400). The input size is constant, so this is an O(1) calculation.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1154. Day of the Year
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source