1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/找到第 k 位数字 [shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof].html

30 lines
894 B
HTML
Raw 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>某班级学号记录系统发生错乱,原整数学号序列 <code>[1,2,3,4,...]</code> 分隔符丢失后变为 <code>1234...</code> 的字符序列。请实现一个函数返回该字符序列中的第 <code>k</code> 位数字。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>k = 5
<strong>输出:</strong>5
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>k = 12
<strong>输出:</strong>1
<strong>解释:</strong>第 12 位数字在序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... 里是 1 ,它是 11 的一部分。</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= k &lt;&nbsp;2<sup>31</sup></code></li>
</ul>
<p>注意:本题与主站 400 题相同:<a href="https://leetcode-cn.com/problems/nth-digit/">https://leetcode-cn.com/problems/nth-digit/</a></p>
<p>&nbsp;</p>