P20913 [GeeksforGeeks] Palindrome in both decimal and binary4517
普及-
题目描述

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 <=10^{7}

输入格式

见题面

输出格式

见题面

样例输入
N = 7
样例输出
"Yes"