Check a Palindrome
Talk it through out loud with your AI coach.
The problem
- easy
Given a sentence, decide whether it reads the same forwards and backwards, ignoring case, spaces and punctuation. For example, "A man, a plan, a canal: Panama" counts as a palindrome. Explain your approach and its cost.
What a strong answer covers
- Comparing the sentence from both ends at once.
- How to deal with spaces, punctuation and capital letters.
- When to stop and what to return.
- The time and memory used, compared with making a cleaned copy.
Common mistake: Building a reversed copy of the whole string when the question is about doing it efficiently.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud