Domanda di colloquio di Intrepid Pursuits

Write a function that returns True or False and checks if a string is a palindrome.

Risposta di colloquio

Anonimo

2 giu 2019

I reversed the string and checked it against the original string. You also need to code to check for exceptions, like an empty string or one letter strings. I used a for loop and ran out of time, but the interviewer said a more optimized solution would return before working through the whole string if the answer was false at any point.