Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Largest Palindrome Product
00:00
5 left

Largest Palindrome Product

HardPython

Problem

Find the largest palindrome made from the product of two 3-digit numbers.

Implement largest_palindrome_product(digits) and call it with digits = 3 for the requested result. Return the palindrome as an integer. The parameter generalizes the same calculation to factor pairs with the specified number of digits.

Input: An integer digits, where 1 <= digits <= 3.

Output: The largest palindromic product of two positive integers having exactly digits digits.

Constraints

  • 1 <= digits <= 3
  • Each factor must have exactly digits decimal digits
  • Factors are positive integers
  • Return the largest palindromic product as an integer

Function Signature

def largest_palindrome_product(digits):
Interviewer

Your question is Largest Palindrome Product. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.