Skip to content

Commit e2416a8

Browse files
committed
Time: 2 ms (84.49%), Space: 42.6 MB (55.25%) - LeetHub
1 parent 7565adc commit e2416a8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public List<Integer> targetIndices(int[] nums, int target) {
3+
4+
Arrays.sort(nums);
5+
List<Integer> res = new ArrayList<>();
6+
7+
for(int i = 0 ; i < nums.length; i++){
8+
if(nums[i] == target){
9+
res.add(i);
10+
}
11+
}
12+
return res;
13+
}
14+
}

0 commit comments

Comments
 (0)