Maximum Number of Visible Points
Unlock detailed company stats for this questionUpgrade
You are standing at the top of a hill at a fixed position. Around you are several trees, each located at a specific (x, y) coordinate and with a certain height. You want to take a photo that captures as many trees as possible within a single frame.
Given your position and the positions of the trees, write an algorithm to determine the maximum number of trees visible within a given viewing angle. Trees that lie in the same direction (same line of sight) should count as one visible tree, since nearer trees block the view of those behind them.
Interview experiences
1 sharedCommunity answers
No answers contributed by the community yet.
Related questions
Maximum Number of Non-Overlapping SubstringsRelated courses

Course

Course
Course
