<s> __author__ = "<STR_LIT>" <EOL> """<STR_LIT>""" <EOL> import string <EOL> import collections <EOL> from deque import Deque <EOL> STRIP = string . whitespace + string . punctuation + "<STR_LIT>" <EOL> def palindrome_checker_with_deque ( str1 ) : <EOL> d1 = Deque ( ) <EOL> d2 = collections . deque ( ) <EOL> for s in str1 . lower ( ) : <EOL> if s not in STRIP : <EOL> d2 . append ( s ) <EOL> d1 . enqueue ( s ) <EOL> eq1 = True <EOL> while d1 . size ( ) > <NUM_LIT:1> and eq1 : <EOL> if d1 . dequeue_front ( ) != d1 . dequeue ( ) : <EOL> eq1 = False <EOL> eq2 = True <EOL> while len ( d2 ) > <NUM_LIT:1> and eq2 : <EOL> if d2 . pop ( ) != d2 . popleft ( ) : <EOL> eq2 = False <EOL> return eq1 , eq2 <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> str1 = '<STR_LIT>' <EOL> str2 = '<STR_LIT>' <EOL> print ( palindrome_checker_with_deque ( str1 ) ) <EOL> print ( palindrome_checker_with_deque ( str2 ) ) </s>
