1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-12-11 21:30:58 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

更新国内版力扣题目描述变更

This commit is contained in:
2022-05-02 23:42:43 +08:00
parent 74598d1cf8
commit 7ea03594b3
198 changed files with 11378 additions and 11118 deletions

View File

@@ -1,20 +1,20 @@
<p>Imagine you are reading in a stream of integers. Periodically, you wish to be able to look up the rank of a number <code>x</code> (the number of values less than or equal to <code>x</code>). lmplement the data structures and algorithms to support these operations. That is, implement the method <code>track (int x)</code>, which is called when each number is generated, and the method <code>getRankOfNumber(int x)</code>, which returns the number of values less than or equal to <code>x</code>.</p>
<p><b>Note:&nbsp;</b>This problem is slightly different from the original one in the book.</p>
<p><strong>Example:</strong></p>
<pre>
<strong>Input:</strong>
[&quot;StreamRank&quot;, &quot;getRankOfNumber&quot;, &quot;track&quot;, &quot;getRankOfNumber&quot;]
[[], [1], [0], [0]]
<strong>Output:
</strong>[null,0,null,1]
</pre>
<p><strong>Note: </strong></p>
<ul>
<li><code>x &lt;= 50000</code></li>
<li>The number of calls of both&nbsp;<code>track</code>&nbsp;and&nbsp;<code>getRankOfNumber</code>&nbsp;methods are less than or equal to 2000.</li>
</ul>
<p>Imagine you are reading in a stream of integers. Periodically, you wish to be able to look up the rank of a number <code>x</code> (the number of values less than or equal to <code>x</code>). lmplement the data structures and algorithms to support these operations. That is, implement the method <code>track (int x)</code>, which is called when each number is generated, and the method <code>getRankOfNumber(int x)</code>, which returns the number of values less than or equal to <code>x</code>.</p>
<p><b>Note:&nbsp;</b>This problem is slightly different from the original one in the book.</p>
<p><strong>Example:</strong></p>
<pre>
<strong>Input:</strong>
[&quot;StreamRank&quot;, &quot;getRankOfNumber&quot;, &quot;track&quot;, &quot;getRankOfNumber&quot;]
[[], [1], [0], [0]]