Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebc7f88

Browse files
refactor 1365
1 parent0ae4d97 commitebc7f88

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

‎src/main/java/com/fishercoder/solutions/_1365.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,6 @@
44
importjava.util.Arrays;
55
importjava.util.List;
66

7-
/**
8-
* 1365. How Many Numbers Are Smaller Than the Current Number
9-
*
10-
* Given the array nums, for each nums[i] find out how many numbers in the array are smaller than it.
11-
* That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].
12-
* Return the answer in an array.
13-
*
14-
* Example 1:
15-
* Input: nums = [8,1,2,2,3]
16-
* Output: [4,0,1,1,3]
17-
* Explanation:
18-
* For nums[0]=8 there exist four smaller numbers than it (1, 2, 2 and 3).
19-
* For nums[1]=1 does not exist any smaller number than it.
20-
* For nums[2]=2 there exist one smaller number than it (1).
21-
* For nums[3]=2 there exist one smaller number than it (1).
22-
* For nums[4]=3 there exist three smaller numbers than it (1, 2 and 2).
23-
*
24-
* Example 2:
25-
* Input: nums = [6,5,4,8]
26-
* Output: [2,1,0,3]
27-
*
28-
* Example 3:
29-
* Input: nums = [7,7,7,7]
30-
* Output: [0,0,0,0]
31-
*
32-
* Constraints:
33-
* 2 <= nums.length <= 500
34-
* 0 <= nums[i] <= 100
35-
* */
367
publicclass_1365 {
378
publicstaticclassSolution1 {
389
publicint[]smallerNumbersThanCurrent(int[]nums) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp