palindrome implementation by using deque