Google Question Asked Onsite

Revision en1, by Sahilamin219, 2024-04-03 13:45:57

count array : for a given array it stores, for each ith element number of element greater than it's value from the left.

For a given number N , there exits an permutation array (1,N) such that it gives you same count array. You are given an count array and you have to find original array.

Example : count array => 0 0 0 1 2 0

then original array would be => 1 2 5 4 3 6

Required Solution was Nlog(N).

Hope the question is clear, if there's any doubt plz comment.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Sahilamin219 2024-04-30 16:03:32 119
en1 English Sahilamin219 2024-04-03 13:45:57 515 Initial revision (published)