Skip to content

Commit 530c31f

Browse files
committed
Create README - LeetHub
1 parent 5648903 commit 530c31f

File tree

1 file changed

+39
-0
lines changed
  • 1482-how-many-numbers-are-smaller-than-the-current-number

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h2><a href="https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number">1482. How Many Numbers Are Smaller Than the Current Number</a></h2><h3>Easy</h3><hr><p>Given the array <code>nums</code>, for each <code>nums[i]</code> find out how many numbers in the array are smaller than it. That is, for each <code>nums[i]</code> you have to count the number of valid <code>j&#39;s</code>&nbsp;such that&nbsp;<code>j != i</code> <strong>and</strong> <code>nums[j] &lt; nums[i]</code>.</p>
2+
3+
<p>Return the answer in an array.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre>
9+
<strong>Input:</strong> nums = [8,1,2,2,3]
10+
<strong>Output:</strong> [4,0,1,1,3]
11+
<strong>Explanation:</strong>
12+
For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3).
13+
For nums[1]=1 does not exist any smaller number than it.
14+
For nums[2]=2 there exist one smaller number than it (1).
15+
For nums[3]=2 there exist one smaller number than it (1).
16+
For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).
17+
</pre>
18+
19+
<p><strong class="example">Example 2:</strong></p>
20+
21+
<pre>
22+
<strong>Input:</strong> nums = [6,5,4,8]
23+
<strong>Output:</strong> [2,1,0,3]
24+
</pre>
25+
26+
<p><strong class="example">Example 3:</strong></p>
27+
28+
<pre>
29+
<strong>Input:</strong> nums = [7,7,7,7]
30+
<strong>Output:</strong> [0,0,0,0]
31+
</pre>
32+
33+
<p>&nbsp;</p>
34+
<p><strong>Constraints:</strong></p>
35+
36+
<ul>
37+
<li><code>2 &lt;= nums.length &lt;= 500</code></li>
38+
<li><code>0 &lt;= nums[i] &lt;= 100</code></li>
39+
</ul>

0 commit comments

Comments
 (0)