Difficulty: Medium | Category: Graph | Asked at: Google, Meta, Amazon | Platform: Unfoldd Arena
Solve Pacific Atlantic Water Flow online for free in Python, JavaScript, Java, C++, TypeScript, Go, Rust, PHP, Swift, Kotlin, Dart, Ruby, C, and C#. Practice Medium level coding interview problems with instant test case evaluation and AI-powered analysis.
Keywords: Pacific Atlantic Water Flow solution, Pacific Atlantic Water Flow leetcode, Pacific Atlantic Water Flow python, Pacific Atlantic Water Flow javascript,Pacific Atlantic Water Flow java, Pacific Atlantic Water Flow approach, how to solve Pacific Atlantic Water Flow, medium coding problems, Graph problems, coding interview preparation, DSA practice free.
Given a 2D matrix
matrixEach cell is marked as either the ocean (
0123For water to flow from the Pacific Ocean to the Atlantic Ocean, cells must be connected horizontally or vertically. We are interested in counting the number of such cells.
matrix0123matrix123mnWrite a function that takes the input
matrixInput: {"input_data":[1,2,3]} Output: [1,2,3]
Solve problems, verify your skills, and earn XP.