Counting Islands and Finding Maximum Island Area in Grids
Counting Islands in a Binary Matrix Given a 2D grid consisting of 1 (land) and 0 (water), count the number of islands. An island is formed by adjacent lands connectde horizontaly or vertically, surrounded by water. The grid boundaries are considered water. Input Format: First line: two integers N, M...