QUIZ: LC_W10
◀ BACK WEEK 10
8 QUESTIONS
Q1 1 / 8 medium
Pacific Atlantic Water Flow

Given an m x n grid of heights, water flows from a cell to adjacent cells with equal or lower height. The Pacific ocean touches the top and left edges; the Atlantic touches the bottom and right edges. Return all cells from which water can flow to both oceans.

What are the subproblems you need to solve?