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:

  1. Determine which trees are visible from outside the grid by looking horizontally or vertically
  2. Calculate a "scenic score" for each tree based on viewing distance in four directions
  3. Find the tree with the highest scenic score

This problem tests your ability to work with 2D grids and perform directional scanning operations.