1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 19:31:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part2

This commit is contained in:
2022-03-27 20:38:29 +08:00
parent 5a4fa6db12
commit 0fc7f4b734
1617 changed files with 134637 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<p>假设你正在读取一串整数。每隔一段时间,你希望能找出数字 x 的秩(小于或等于 x 的值的个数)。请实现数据结构和算法来支持这些操作,也就是说:</p>
<p>实现 <code>track(int x)</code>&nbsp;方法,每读入一个数字都会调用该方法;</p>
<p>实现 <code>getRankOfNumber(int x)</code> 方法,返回小于或等于 x 的值的个数。</p>
<p><strong>注意:</strong>本题相对原题稍作改动</p>
<p><strong>示例:</strong></p>
<pre><strong>输入:</strong>
[&quot;StreamRank&quot;, &quot;getRankOfNumber&quot;, &quot;track&quot;, &quot;getRankOfNumber&quot;]
[[], [1], [0], [0]]
<strong>输出:
</strong>[null,0,null,1]
</pre>
<p><strong>提示:</strong></p>
<ul>
<li><code>x &lt;= 50000</code></li>
<li><code>track</code>&nbsp;&nbsp;<code>getRankOfNumber</code> 方法的调用次数均不超过 2000 次</li>
</ul>