Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5701 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 938 |
@bt8816103042 | 739 |
@SHOAIBVIJAPURE | 428 |
@codeantik | 412 |
@SherlockHolmes3 | 407 |
@neverevergiveup | 348 |
@mahlawatep | 347 |
@shalinibhataniya1097 | 343 |
@murarry3625 | 333 |
@saiujwal13083 | 326 |
@rohitanand | 314 |
Complete Leaderboard |
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
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes