FunctionRacerProblemsRace

Binary Palindrome

EasyMathPython, JavaScript, TypeScript, Java, C++

Return True if the binary form of n (no leading zeros) reads the same forwards and backwards, otherwise False.

Example 1

n 9
returns true

1001 is a palindrome.

Example 2

n 10
returns false

1010 is not.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems