Monday, November 30, 2015

LintCode: Count of Smaller Number before itself

Count of Smaller Number before itself

Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) . For each element Ai in the array, count the number of element before this element Ai is smaller than it and return count number array.
Example
For array [1,2,7,8,5], return [0,1,2,3,2]
Note
Understand the problem:

No comments:

Post a Comment