We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90fd493 commit 08cc947Copy full SHA for 08cc947
LeetcodeProblems/Algorithms/Count of Smaller Numbers After Self
@@ -1,3 +1,23 @@
1
+Question:
2
+Input: nums = [5,2,6,1]
3
+Output: [2,1,1,0]
4
+Explanation:
5
+To the right of 5 there are 2 smaller elements (2 and 1).
6
+To the right of 2 there is only 1 smaller element (1).
7
+To the right of 6 there is 1 smaller element (1).
8
+To the right of 1 there is 0 smaller element.
9
+
10
+Example 2:
11
12
+Input: nums = [-1]
13
+Output: [0]
14
+Example 3:
15
16
+Input: nums = [-1,-1]
17
+Output: [0,0]
18
19
20
21
def countSmaller(nums):
22
result = []
23
for i in range(len(nums)):
0 commit comments