Binary Palindrome Check

Bit Manipulation Binary Palindrome Easy Coding Challenge

Problem Description

Given a non-negative integer, determine if its binary representation is a palindrome. A binary palindrome means that when the binary representation of the number is read from left to right, it is the same as when read from right to left.

For example:

  • Input: 9

    • Binary Representation: 1001
    • This is a palindrome, so the output should be True.
  • Input: 10

    • Binary Representation: 1010
    • This is not a palindrome, so the output should be False.

Example

Input: 9

Output: True

Constraints

  • The input will be a single non-negative integer.
  • Aim to solve this problem with bit manipulation techniques.

Note: This problem is inspired by the creative spirit of problem-solving often celebrated on historical technical celebration days. Enjoy coding and happy problem-solving!


Starter Code

Below are language-specific starter code templates to help you begin your solution. You can pick the language of your choice.