Problem 52522. Easy Sequences 4: Eliminate the Days of Confusion
If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, "05-02-1998", may mean either "May 02, 1998" or "February 05, 1998". However, since there are only 12 months in a year, not all dates are confusing. "23-10-1969" is clearly "October 23, 1969".
Write a program that will count the number of days between two dates (inclusive) that are NOT confusing on either "dd-mm-yyyy" or "mm-dd-yyyy" formats.
To avoid further confusion you are given the input in "yyyy-mm-dd" date format.
Solution Stats
Problem Comments
-
3 Comments
Nikolaos Nikolaou
on 6 Oct 2021
Lol that was fun :)
Ramon Villamangca
on 2 Nov 2021
Thanks Nikolas...
Rafael S.T. Vieira
on 13 Nov 2022
Ok, I figure it out which day is not confusing between the confusing ones.
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
Calculate the area of a triangle between three points
2943 Solvers
-
Circular Primes (based on Project Euler, problem 35)
494 Solvers
-
Check that number is whole number
4334 Solvers
-
Pattern Recognition 1 - Known Unit Length
57 Solvers
-
2007 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!