Checking for Musical Palindromes using Queues
Continuing with the discussion on queues, one easy type of question is Valid Palindrome. We can check if a string is a palindrome using a queue. The palindrome is defined as a string that, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, reads the same forward and backward. We can check if a string has alphanumeric characters using isalnum() and we can convert a string to lowercase letters using lower(). Additionally, we can use the deque class of queues (double-ended queues) to literally check both ends of the string.
