Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1154. Day of the Year
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.