Number of Days Between Two Dates Problem

Number of Days Between Two Dates Problem — ExecCode Easy DSA Practice

Solve the Number of Days Between Two Dates problem on ExecCode. Free online easy DSA practice in Math. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Number of Days Between Two Dates. Your task is to write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples. Return the required answer exactly as shown in the examples.

Examples

Input {"date1": "2019-06-29", "date2": "2019-06-30"}; Output 1. Input {"date1": "2020-01-15", "date2": "2019-12-31"}; Output 15

Constraints

The given dates are valid dates between the years 1971 and 2100.

Practice Number of Days Between Two Dates free on ExecCode. Browse DSA problems, topic map, and placement guides.