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

Commite01318a

Browse files
refactor 1282
1 parent28f43d4 commite01318a

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,6 @@
55
importjava.util.List;
66
importjava.util.Map;
77

8-
/**
9-
* 1282. Group the People Given the Group Size They Belong To
10-
*
11-
* There are n people whose IDs go from 0 to n - 1 and each person belongs exactly to one group.
12-
* Given the array groupSizes of length n telling the group size each person belongs to, return the groups there are and the people's IDs each group includes.
13-
* You can return any solution in any order and the same applies for IDs.
14-
* Also, it is guaranteed that there exists at least one solution.
15-
*
16-
* Example 1:
17-
* Input: groupSizes = [3,3,3,3,3,1,3]
18-
* Output: [[5],[0,1,2],[3,4,6]]
19-
* Explanation:
20-
* Other possible solutions are [[2,1,6],[5],[0,4,3]] and [[5],[0,6,2],[4,3,1]].
21-
*
22-
* Example 2:
23-
* Input: groupSizes = [2,1,3,3,3,2]
24-
* Output: [[1],[0,5],[2,3,4]]
25-
*
26-
* Constraints:
27-
* groupSizes.length == n
28-
* 1 <= n <= 500
29-
* 1 <= groupSizes[i] <= n
30-
* */
318
publicclass_1282 {
329
publicstaticclassSolution1 {
3310
publicList<List<Integer>>groupThePeople(int[]groupSizes) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp