People with distinct heights stand in a line. Person i can see person j (j > i) if everyone strictly between them is shorter than both. For each person, return how many people to their right they can see. The input is JSON {heights}.
Input: JSON {heights}.
Output: Array — the count of visible people to the right of each.
Input: {"heights":[10,6,8,5,11,9]}
Output: [3,1,2,1,1,0]
Explanation: Each person's rightward visibility.Input: {"heights":[5,1,2,3,10]}
Output: [4,1,1,1,0]
Explanation: Person 0 sees 1,2,3 and the taller 10.Input: {"heights":[7]}
Output: [0]
Explanation: No one to the right.1<=n<=10^5distinct heights