Leetcode in Java && Oracle
419 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2021-11-29_17-37-18.png
29.5 KB
#N2089. Find Target Indices After Sorting Array
problem link

#solution
class Solution {
public List<Integer> targetIndices(int[] nums, int target) {
Arrays.sort(nums);
List<Integer> list = new ArrayList<>();

for(int i=0; i<nums.length; i++)
if(nums[i]==target) list.add(i);

return list;
}
}