**Problem Description**

Given an integer **A** find the **A ^{th}** number whose binary representation is a palindrome.

**NOTE:**

- Consider the 1
^{st}number whose binary representation is palindrome as 1, instead of 0 - Do not consider the leading zeros, while considering the binary representation.

1 <= A <= 2*10 ^{4}*

First and only argument is an integer **A**.

Return an integer denoting the **A ^{th}** number whose binary representation is a palindrome.

Input 1:

A = 1

Input 1:

A = 9

Output 1:

1

Output 2:

27

Explanation 1:

1^{st}Number whose binary representation is palindrome is 1

Explanation 2

9^{th}Number whose binary representation is palindrome is 27 (11011)

NOTE:You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.

- Hint 1
- Solution Approach
- Complete Solution

Loading...