Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 32x 7x 5x 5x 5x 7x 5x 5x 3x 1x | export function isPalindrome(input: string): boolean { if (input.length === 0 || input.length === 1) return true; let i = 0; let j = input.length - 1; while (i < j) { if (input[i] !== input[j]) return false; i++; j--; } return true; } console.log(isPalindrome("racecar")); |