Lakhankumawat / LearnCPP

Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
https://lakhankumawat.github.io/LearnCPP/
MIT License
642 stars 490 forks source link

Max Area Of Island using DFS #1560

Closed harshb910 closed 2 years ago

harshb910 commented 2 years ago

Related Issue

Proposed Changes

Additional Info

Checklist

I have added a problem to find the maximum area of the island in a matrix using depth-first search algorithm for graph traversal.

You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

The area of an island is the number of cells with a value 1 in the island.

Return the maximum area of an island in grid. If there is no island, return 0.

Output Screenshots

Screenshot #1 Screenshot #2
Code Output
harshb910 commented 2 years ago

Please review my PR @Lakhankumawat

github-actions[bot] commented 2 years ago

This PR is stale because it has been open 3 days with no activity. Please commit the changes requested or make improvements on the code. Thank you for your contributions!