Cairnbin

Untitled

text 76 views Created: November 6, 2026 at 11:31:13 EST
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Find Target Indices After Sorting Array (LeetCode 2089)

Indices of target after sorting.

## Approach

```python
def targetIndices(nums, target):
    nums.sort()
    return [i for i,x in enumerate(nums) if x==target]
```

## Complexity

- Time / space depend on the scan above; keep the solution linear when possible.

## Interview tip

Narrate the invariant before coding. I drill these patterns with [AI assistant for technical interviews](https://www.linkjob.ai/coding-interview-copilot/) ahead of OA rounds.

*Disclosure: I work on Linkjob AI, an interview copilot. The algorithm above stands on its own.*

Embed this paste

Install this app

  1. Tap the Share button
  2. Scroll down and tap "Add to Home Screen"
  3. Tap "Add" in the top right

Please confirm