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 commentsGroup

Easy Sequences Volume I
- 10 Problems
- 8 Finishers
- Easy Sequences 1: Find the index of an element
- Easy Sequences 2: Trigonometric function with integral input and output
- Easy Sequences 3: Prime 44-number Squares
- Easy Sequences 4: Eliminate the Days of Confusion
- Easy Sequences 5: Project Euler Problem 1 - Again!
- Easy Sequences 6: Coefficient sums of derivatives
- Easy Sequences 9: Faithful Pairs
- Easy Sequences 10: Sum of Cumsums of Fibonacci Sequence
- Easy Sequences 11: Factorial Digits without Trailing Zeros
- Easy Sequences 12: 50th Prime
Problem Recent Solvers21
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!