VFlash: Fast, Accurate Visual Planning via Flash Primitive Decoding
u_Unrolled
DSA for AI/ML · Module 03: Two pointers

Lesson 3.2 of 10 in this module Unrolled Pro

Valid Palindrome

Is a sentence the same forwards and backwards, ignoring case and punctuation? From building a cleaned copy and reversing it, to two converging pointers that skip junk in place with O(1) memory. Then one allowed deletion, k deletions, and why text normalisation is the real bug in production.

about 10 min 3 Python examples 2 quick checks

Problem. After converting to lowercase and ignoring every character that isn't a letter or digit, does s read the same forwards and backwards?

text
"A man, a plan, a canal: Panama"   →   True
"race a car"                        →   False
" "                                 →   True     (empty after cleaning)

ML context. The skill here isn't palindromes; it's comparing text after normalisation. Every tokenizer and dedup pipeline decides what counts as "the same" text (case, punctuation, accents, whitespace). Doing that comparison in place, without building cleaned copies, matters when you're scanning terabytes of documents.


1. Step 1: Clarify

That's the preview. Modules 00–01 are free; this lesson is part of Unrolled Pro.
Staff AI & Pro Tier Lesson

Unlock "Valid Palindrome"

The foundations are free forever. Unrolled Pro unlocks the complete lesson, production architectures, and 55 battle-tested ML system design case studies.

Everything included with Pro:
All 234+ Deep-Dive Lessons across transformer internals, inference, RAG & agents
55 Staff-Level ML & System Design Case Studies with mathematical capacity estimates
AI Engineer Sheet & Exercises with worked solutions, self-checks, and code
100 Landmark Research Papers guided walkthroughs & progress tracking
14-Day Money-Back Guarantee — 100% full refund if you aren't satisfied
View Plans & Unlock All Lessons

From ₹167/mo (~$2/mo) · Cancel anytime · Instant activation

100% Risk-Free: 14-day no-questions-asked money-back guarantee