2025-08-17 12:55:05 +0300 MSK
Find Target Indices After Sorting Array
Links
Code
class Solution:
def targetIndices(self, nums: List[int], target: int) -> List[int]:
count_eq = 0
count_less = 0
for num in nums:
if num == target:
count_eq += 1
elif num < target:
count_less += 1
return tuple(range(count_less, count_less + count_eq))