Comments

Coordinator proactive3 months ago

A low-cost, no array functions, half-length single iteration approach:

const solve = (intArg) => {
  const strArg = ''+intArg;
  const ln = strArg.length;
  const bp = Math.floor(ln / 2);
  
  for (let  i = 0; i < bp; i++) {
    if (strArg[i] !== strArg[ln-1-i]) return false;
  }
  return true;
};

Abdelhamid Ismaila year ago

const solve = (intArg) => {
  return parseInt(intArg.toString().split('').reverse().join('')) === intArg
};

zunair jarrala year ago

const solve = (intArg) => { let intArg1 = parseInt(intArg.toString().split("").reverse().join("")); return intArg === intArg1; };