Pregunta de entrevista de Amazon

palindrome question from the leetcode