← All problemsSign in

AppleTrees

Apple Trees Apple trees in a garden form a rectangular grid. A group of monkeys lives on these trees. Not more than one monkey lives in each tree. A monkey feels happy to believe that it is the lord of all apple trees it views from the top of the tree it lives in. However, as the trees are of different heights a monkey can view trees that are not obstructed from its view by other tree

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start