function isLetter(c: string) {
  if (/\d/.test(c)) return true;
  return c.toLowerCase() != c.toUpperCase();

}

export function isPalindrome(s: string): boolean {
  let L = 0;
  let R = s.length - 1;

  while (L <= R) {
    let lChar = s[L].toLowerCase();
    let rChar = s[R].toLowerCase();

    if (!isLetter(lChar)) {
      L++;
      continue;
    }
    if (!isLetter(rChar)) {
      R--;
      continue;
    }

    if (lChar !== rChar) return false;
    L++;
    R--;
  }

  return true;
};
