2089. Find Target Indices After Sorting Array

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 2089

class Solution:
    def targetIndices(self, nums: List[int], target: int) -> List[int]:
        nums.sort()
        return [i for i, v in enumerate(nums) if v == target]