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 Solvers18
Suggested Problems
-
Extract leading non-zero digit
2049 Solvers
-
Piecewise linear interpolation
528 Solvers
-
317 Solvers
-
645 Solvers
-
Easy Sequences 2: Trigonometric function with integral input and output
32 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!