2 of 5
edited tags
Kevin Cruijssen
  • 126.2k
  • 11
  • 140
  • 377

Is this number a palindrome?

Input

A single 16-bit integer. This is non-negotiable, but standard I/O formats apply.

Output

A truthy or falsely value, depending on whether the given number is palindromic (same forwards and backwards)

Rules

  • Numbers will always be positive, at least two digits long, and less than 99999999.
  • This is , so lowest O(n) time complexity wins.

Test cases

  • 123454321 - true
  • 296296 - false
  • 296692 - true
  • 5499456 - false
  • 0 - false/error/any value