1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-12 08:55:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/超级回文数 [super-palindromes].html
2025-09-29 14:43:44 +08:00

34 lines
1.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>如果一个正整数自身是回文数,而且它也是一个回文数的平方,那么我们称这个数为 <strong>超级回文数</strong></p>
<p>现在,给你两个以字符串形式表示的正整数 <font color="#c7254e" face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="caret-color: rgb(199, 37, 78); font-size: 12.6px; background-color: rgb(249, 242, 244);">left</span></font>&nbsp;<font color="#c7254e" face="Menlo, Monaco, Consolas, Courier New, monospace"><span style="caret-color: rgb(199, 37, 78); font-size: 12.6px; background-color: rgb(249, 242, 244);">right</span></font>&nbsp; ,统计并返回区间&nbsp;<code>[left, right]</code> 中的 <strong>超级回文数</strong> 的数目。</p>
<p>&nbsp;</p>
<p><b>示例 1</b></p>
<pre>
<b>输入:</b>left = "4", right = "1000"
<b>输出:</b>4
<b>解释:</b>4、9、121 和 484 都是超级回文数。
注意 676 不是超级回文数26 * 26 = 676 ,但是 26 不是回文数。
</pre>
<p><b>示例 2</b></p>
<pre>
<b>输入:</b>left = "1", right = "2"
<b>输出:</b>1
</pre>
<p>&nbsp;</p>
<p><b>提示:</b></p>
<ul>
<li><code>1 &lt;= left.length, right.length &lt;= 18</code></li>
<li><code>left</code>&nbsp;&nbsp;<code>right</code>&nbsp;仅由数字0 - 9组成。</li>
<li><code>left</code>&nbsp;&nbsp;<code>right</code>&nbsp;不含前导零。</li>
<li><code>left</code>&nbsp;&nbsp;<code>right</code>&nbsp;表示的整数在区间&nbsp;<code>[1, 10<sup>18</sup> - 1]</code> 内。</li>
<li><code>left</code>&nbsp;小于等于&nbsp;<code>right</code>&nbsp;</li>
</ul>