Error
|
|
---|---|
@Ibrahim Nash | 5765 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4993 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1286 |
@bt8816103042 | 739 |
@rohitanand | 495 |
@codeantik | 479 |
@shalinibhataniya1097 | 472 |
@amrutakashikar2 | 464 |
@thealchemist627 | 456 |
@akashkale117 | 453 |
@shivanandp12345678910 | 453 |
@dalwainazism125 | 453 |
@SherlockHolmes3 | 447 |
Complete Leaderboard |
Given a value N, find out the largest palindrome number which is product of two N-digit numbers.
Example 1:
Input: N = 2 Output: 9009 Explanation: 9009 is the largest number which is product of two 2-digit numbers. 9009 = 91*99.
Example 2:
Input: N = 1
Output: 9
Explanation: 9 is the largest number
which is product of two 1-digit numbers.
3 * 3 = 9.
Your Task:
You don't need to read or print anyhting. Your task is to complete the function LargestProductPalin() which takes N as input parameter and returns largest palindromic product of 2 N-digit numbers.
Expected Time Complexity: O(10n+1)
Expected Space Complexity: O(1)
Constraints:
1 <= N <= 6
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes