num. Return True if its decimal notation reads the same left to right and right to left, and False otherwise. A minus sign counts as part of the notation.
Bonus: can you do it without turning the number into a string?num=45654 → True
The digits 4, 5, 6, 5, 4 are the same in both directions.
num=-77 → False
Right to left it reads "77-", which is not the same as "-77".
num=320 → False
Backwards it reads "023", which differs from "320".
num=45654
True
Run checks the first 3 tests in your browser. Submit checks all 40 tests on the server, hidden ones included.