solulubeta
Sign in
Recursion & Memo / See it, then write it
01.08 · Problem

Palindrome Check

Easy Two ends move inward Pro

Return true if s reads the same forwards and backwards. Compare characters exactly, so A and a are different. Use two indices and don’t build new strings.

Examples

Example 1

Input:  s = "racecar"
Output: true

Example 2

Input:  s = "abca"
Output: false
solulu Pro

Continue this problem with Pro

Inside: step-by-step hints · 12 hidden tests · reference solutions · code editor.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 8 of 44 · updated 2026-10-13