Available question text
Given an unsorted array of numbers, return an array where each element is replaced with the index it would have in a sorted array. Example: [8,5,4,3,1] -> [4,3,2,1,0]. Follow-up: Is it possible to solve this faster than O(nlogn)?
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Replace Elements with Indices in Sorted Array
Reported Sep 25, 2024 · 1 source report
JUNIOR
Source snapshot: Nov 12, 2026
View source