Number of Islands II

Number of Islands II

Given an initially all-water m × n grid, perform k land-addition operations. Each operation turns position (row, col) from water into land. Return the number of islands ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: