We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #4: Largest palindrome product

Project Euler #4: Largest palindrome product

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 4 from projecteuler.net

A palindromic number reads the same both ways. The smallest 6 digit palindrome made from the product of two 3-digit numbers is .

Find the largest palindrome made from the product of two 3-digit numbers which is less than .

Input Format

First line contains that denotes the number of test cases. This is followed by lines, each containing an integer, .

Constraints

Output Format

Print the required answer for each test case in a new line.

Sample Input 0

2
101110
800000

Sample Output 0

101101
793397

Explanation 0

  • is product of and .
  • is product of and .

Author

shashank21j

Difficulty

Medium

Max Score

100

Submitted By

25291

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits

Choose a translation


  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy