Left Pointer (i)
-
⟷
Right Pointer (j)
-
🚪 Door Status: LOCKED
Select rooms to form a palindromic sequence
👹
👺
👻
📜 Comparison Steps
Validation steps will appear here...
⏱️ Timed Challenge
Find all palindromic substrings before time runs out!
Level 1: Classic
RACECAR
Level 2: Multiple
ABACABA
Level 3: Kayak
KAYAK
Level 4: Challenge
ALGORITHM
💡 Algorithm: isPalindromic(s, i, j)
function isPalindromic(s, i, j) { // Base case: single char or empty
if (i >= j) return true; // Compare characters at positions i and j if
(s[i] !== s[j]) { return false; // Mismatch found } // Move pointers
inward and recurse return isPalindromic(s, i + 1, j - 1); } //
Iterative version (two-pointer technique) function
isPalindromicIterative(s, i, j) { while (i < j) { if (s[i] !== s[j]) {
return false; } i++; j--; } return true; }