Leaderboard
Showing:
Palindrome in both Decimal and Binary
Basic Accuracy: 0.0% Submissions: 0 Points: 1

Given a number N. check whether a given number N  is palindrome or not in it's both formates (Decimal and Binary ).

Example 1:

Input: N = 7
Output: "Yes" 
Explanation: 7 is palindrome in it's decimal 
and also in it's binary (111).So answer is "Yes".

Example 2:

Input: N = 12
Output: "No"
Explanation: 12 is not palindrome in it's decimal
and also in it's binary (1100).So answer is "No". 


Your Task:  
You don't need to read input or print anything. Complete the function isDeciBinPalin() which takes N as input parameter and returns "Yes" if N is a palindrome in its both formates else returns "No".

Expected Time Complexity: O(logN
)
Expected Auxiliary Space: O(1)

Constraints:
1<= N <=107

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Palindrome in both Decimal and Binary

Output Window