Comments (6)
Hello @nizar787 , I can add that solution, Assign me this issue under hacktoberfest
from hacktoberfest.
please review my code
from hacktoberfest.
This is the code can you please review this code
#include
#include
using namespace std;
class Solution {
public:
int numIslands(vector<vector>& grid) {
if (grid.empty() || grid[0].empty()) {
return 0;
}
int numIslands = 0;
int m = grid.size();
int n = grid[0].size();
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (grid[i][j] == '1') {
numIslands++;
dfs(grid, i, j);
}
}
}
return numIslands;
}
private:
void dfs(vector<vector>& grid, int i, int j) {
if (i < 0 || i >= grid.size() || j < 0 || j >= grid[0].size() || grid[i][j] != '1') {
return;
}
grid[i][j] = '0';
dfs(grid, i - 1, j);
dfs(grid, i + 1, j);
dfs(grid, i, j - 1);
dfs(grid, i, j + 1);
}
};
from hacktoberfest.
i have solved this problem before,i m attaching my leetcode profile,please assign it to me
https://leetcode.com/pritishyo10/
from hacktoberfest.
I have solved this problem before,I am attaching my leetcode profile,please assign it to me
https://leetcode.com/navya975/
from hacktoberfest.
assigned this problem to me
from hacktoberfest.
Related Issues (20)
- Feature: Clone of some basic unix commands HOT 1
- Write code for some basic unix commands HOT 1
- Fidget Spinner Game using python HOT 2
- Add merge sort implementation using python
- Feature: I Would like to add Some BASIC IDEAS ABOUT C++. HOT 6
- Feature: Enter 10 numbers into an array and find the 3rd largest from it. HOT 30
- Error: HOT 1
- String game using Java HOT 4
- Feature: LeetCode Solutions
- Feature: Adding Radix Sort in Java HOT 5
- Feature: HOT 1
- Feature: Sudoku Solver Leet code question
- Want to Add my cpp project of car Sales Management System
- Feature: Adding disjoint set problem in DSA folder HOT 2
- Feature: Tic-Tac-Toe HOT 2
- Adding new implementation problem which is LFU cache under cpp under leetcode solutions HOT 1
- Feature: Random Joke Generator HOT 6
- An E-learning Android Application
- Want to change repo's name from hacktoberfest2021 to hacktoberfest2023 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hacktoberfest.