
nums 오름차 순 정렬i번째 요소가 target과 같다면, 정답 배열에 추가target과 동일한 요소들의 인덱스 반환function targetIndices(nums: number[], target: number): number[] {
const sorted = nums.toSorted((a, b) => a - b)
const indices = []
for(let i = 0; i < sorted.length; i++) {
if(sorted[i] === target) indices.push(i)
}
return indices
};