1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/算法题(国内版)/problem (Chinese)/数字序列中某一位的数字 [shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof].html

27 lines
754 B
HTML
Raw Normal View History

2022-03-27 20:38:29 +08:00
<p>数字以0123456789101112131415&hellip;的格式序列化到一个字符序列中。在这个序列中第5位从下标0开始计数是5第13位是1第19位是4等等。</p>
<p>请写一个函数求任意第n位对应的数字。</p>
<p>&nbsp;</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>&nbsp;</p>
<p><strong>限制:</strong></p>
<ul>
<li><code>0 &lt;= n &lt;&nbsp;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>