mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-11 02:58:13 +08:00
27 lines
754 B
HTML
27 lines
754 B
HTML
<p>数字以0123456789101112131415…的格式序列化到一个字符序列中。在这个序列中,第5位(从下标0开始计数)是5,第13位是1,第19位是4,等等。</p>
|
||
|
||
<p>请写一个函数,求任意第n位对应的数字。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>n = 3
|
||
<strong>输出:</strong>3
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre><strong>输入:</strong>n = 11
|
||
<strong>输出:</strong>0</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>限制:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>0 <= n < 2^31</code></li>
|
||
</ul>
|
||
|
||
<p>注意:本题与主站 400 题相同:<a href="https://leetcode-cn.com/problems/nth-digit/">https://leetcode-cn.com/problems/nth-digit/</a></p>
|