Introduction
As we all know, puzzles can have a significant impact on our development. Puzzles help us develop our problem-solving and critical-thinking abilities, which are both necessary for mastery of other skills later in life. So let us now discuss the puzzle last palindromic date.
This article will discuss a famous interview puzzle named the last palindromic date. But before discussing the puzzle, we should first discuss what a palindrome is. A palindrome is a word that reads the same from starting and ending.
For example, consider this word tenet,
It reads the same from forward and backward.
Now, since we know what a palindrome is, we should look at the problem statement of the puzzle.
Problem Statement
We are given a date of the year 2001; the date is October 2, 2001. If we convert this date to MM/DD/YYYY format, this date can be written as 10/02/2001. This date can be considered a palindrome since it reads the same from forward and backward. Since we can consider this date a palindrome, therefore, we can call this date a palindromic date. Our task is to find a palindromic date that occurred just before this date. Examples: 11/02/2011 if we put the date in a string as 11022011 and reverse it, it would give us 11022011 which is the same as the original string thus making it and the date a palindrome. Similarly, if we put the date 12/02/2021 into a string as 12022021 and reverse it, it would give us 12022021 which is the same as the original string making it a palindrome.