Android & iPhone apps are coming soon. Log in for a plan and reminders made for you →

Warm-ups · 14 of 24

Check if a string is a palindrome

Return true if the string reads the same forwards and backwards (compare characters exactly, case matters).

Examples

Input s = "madam"

Output true

Input s = "Aa"

Output false

'A' and 'a' are different characters here.

📘 New to this? Two pointers from opposite ends explains the idea in a few minutes.

Solved it? The same idea on LeetCode: try it there ↗

Your code · Python

Stuck?