Day 8: Treetop Tree House
Day 8 involves analyzing a grid of trees to determine visibility and scenic scores.
Problem Overview
You're trying to find the best spot for a treehouse in a forest. Given a grid where each cell contains a tree with a certain height, you need to:
- Determine which trees are visible from outside the grid by looking horizontally or vertically
- Calculate a "scenic score" for each tree based on viewing distance in four directions
- Find the tree with the highest scenic score
This problem tests your ability to work with 2D grids and perform directional scanning operations.
Navigation
- Problem Description: Detailed description of the day's challenge
- Solution Explanation: Walkthrough of the approach used
- Code: The complete implementation with comments