first_in to first_out inclusive, the second from second_in to second_out inclusive. Each date is a string "MM-DD" (month and day).
Count the days both friends are in town at the same time.
All dates fall in the same non-leap year. The month lengths are [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31].first_in="07-28", first_out="08-03", second_in="08-01", second_out="08-10" → 3
They are both at the seaside on August 1, 2 and 3: three days.
first_in="02-27", first_out="03-02", second_in="02-20", second_out="03-31" → 4
The year is not a leap year: February 27 and 28, then March 1 and 2, four days.
first_in="05-01", first_out="05-10", second_in="05-11", second_out="05-20" → 0
The second friend arrives the day after the first one leaves, so they share no days.
"MM-DD" format and exists in a non-leap yearfirst_in ≤ first_out, second_in ≤ second_outfirst_in="07-28", first_out="08-03", second_in="08-01", second_out="08-10"
3
Run checks the first 3 tests in your browser. Submit checks all 115 tests on the server, hidden ones included.