3
* Algorithm: - Parse the array once and count how many are lesser than target and how many are4
* equal - DO NOT sort the array as we don't need it sorted. Just to know how many are lesser and5
* how many are equal. O(N) better than O(NlogN - sorting) - The response list will have a size =6
* with the number of equal elements (as their positions) - Loop from smaller to smaller+equal and7
* add the values into the list. Return the list9
public List<Integer> targetIndices(int[] nums, int target) {12
for (int num : nums) {15
} else if (num == target) {19
List<Integer> indices = new ArrayList<>(equal);20
for (int i = smaller; i < smaller + equal; i++) {