- 1of 1 vote
Given a number N, Assume a lexicographical ordered 1 to N numbers.- keviIma November 06, 2018 in United States
Given array consisting of indices, return the array with numbers at that positions in the lexicographically sorted array of [1 to N].
follow up: Do not use Extra memory.
Expected Runtime = O( N * log k) or O(N)
N = total numbers, (1 to N)
k = Number of queries
N = 12
lexicographical ordered array = [1,10,11,12,2,3,4,5,6,7,8,9]
Query = [1 , 4]
return = [10, 2]
| Report Duplicate | Flag | PURGE
Open Chat in New Window