Logo
IconChallenge
Icon
IconProblem
IconSolutions
IconSubmissions

Super Palindromes

XPChallenge Points: 30
levelLevel: Hard

A super-palindrome is defined as a number that meets two conditions:

  1. The number itself must read the same forward and backward (a palindrome).

  2. The number must also be the square of another palindrome.

You are given two string values, left and right, representing the lower and upper bounds of a range.
Your task is to calculate how many super-palindromes fall within this inclusive interval.

Example 1:

Input: left = "10", right = "5000"

Output: 5

Explanation:

Valid super-palindromes include: 121, 484, 10201, 12321, 14641.

Example 2:

Input: left = "400", right = "10000"

Output: 2

Explanation:

Only 484 and 10201 lie within this range.

to Continue
like
dislike

Accepted:

Submission:

IconReport an issue
Icon
IconCode
IconYou need toto run or submitYou need toto run or submit
IconTest Case
IconTest Result