RAZORTHINK On-Campus OA (2024) | Problem Find Target Indices After Sorting Array

Question · Posted Jun 2026

Problem Statement You are given an integer array nums and an integer target. Your task is to sort the array in non-decreasing order and return the list of indices where the value is equal to target in the sorted array. The returned indices must be in increasing order. Example 1 Input nums = [1,2,5,2,3] target = 2 Output [1,2] Explanation After sorting: [1,2,2,3,5] The value 2 appears at indices 1 and 2. Example 2 Input nums = [1,2,5,2,3] target = ...

The full answer & interview discussion are available to premium members.

Log in Create a free account