Skip to content

Maximum Subtree of the Same Color

A Medium coding interview problem in the Trees pattern.

Likely pattern

Trees

Recursive DFS and level-order BFS over hierarchical data.

Recognition cue: A binary tree or BST: depth, paths, ancestors, or level-by-level processing.

Do not confuse it with

Topics

  • Array
  • Dynamic Programming
  • Tree
  • Depth-First Search
  1. 1Medium
  2. 2Medium
  3. 3Medium
  4. 4Medium
  5. 5Medium
  6. 6Medium
  7. 7Medium
  8. 8Medium