there n people stand queue number 0 n 1 leave right order you give array height distinct integer heightsi represent height ith personA person person right queue everybody short more formally ith person jth person j minheightsi heightsj maxheightsi1 heightsi2 heightsj1Return array answer length n answeri number people ith person right queue Example 1input height 10685119output 312110ExplanationPerson 0 person 1 2 4person 1 person 2person 2 person 3 4Person 3 person 4Person 4 person 5Person 5 right themExample 2input height 512310output 41110 Constraintsn heightslength1 n 1051 heightsi 105all value height unique