Hiring process8 levels
  1. 1 IQ Test
  2. 2 Additional Online Test (If Required)
  3. 3 Office Interview with Hiring Manager
  4. 4 Unpaid Test Task (Motivation Check)
  5. 5 Paid Test Task and Follow-Up Interview
  6. 6 Iterative Paid Test Tasks
  7. 7 Office Verification
  8. 8 Final Interview with the Founder

Problems > Days Apart > Editorial

Days Apart — Solution & Editorial

Back to the Problem

Convert each date to a day count from a fixed epoch with the civil-days formula (or era/400-year arithmetic) and subtract — no month-walking loops needed.

Complexity: O(1)

Watch out: Leap-century rules (1900 no, 2000 yes) break naive 365.25-based math.