Count visible people in a line
People stand in a line and heights[i] is the height of the person at position i. Two people can see each other when nobody standing between them is taller than both of them.
First return how many people the last person in the line can see. Then return that count for every position.
No answer yet. Write the first one; the best answer gets endorsed.
