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.
t = int(input().strip())
for a0 in range(t):
n = int(input().strip())
palindrome = 0
while palindrome==0:
n -=1
if str(n)==str(n)[::-1]:
for j in range(100, 999):
f = n/j
if f%1 == 0 and f <= 999:
f= int(f)
palindrome=n
break
print(palindrome)#, "\n factors:", j, "X", f)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #4: Largest palindrome product
You are viewing a single comment's thread. Return to all comments →
t = int(input().strip()) for a0 in range(t): n = int(input().strip()) palindrome = 0