# 回文数

function isLoop(num) {
  for (let left = 0, right = num.length - 1; left < right; left++, right--) {
    if (num[left] !== num[right]) return false;
  }

  return true;
}

console.log(isLoop("12321"));
console.log(isLoop("123211"));
1
2
3
4
5
6
7
8
9
10
Last Updated: 6/27/2023, 7:40:45 PM