2 051
المشتركون
لا توجد بيانات24 ساعات
لا توجد بيانات7 أيام
لا توجد بيانات30 أيام
أرشيف المشاركات
Hi D Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
RAPIDD Technologies Off Campus Drive Hiring Freshers
CTC 4,80,000
Apply Now❤
https://youtu.be/qO_seKQJbCI
Hi Mr Welcome to this Community. Join Our Channel for daily Off-Campus Job Updates ❤️
👇👇
@offcampusjobs_0
@offcampusjobs_0
Special offer for students! Internshala Trainings is offering a huge discount on all its online trainings which can be learned from the comfort of your home. You can choose to learn 50+ skills like Digital Marketing, Web Development, Creative Writing, among others. Use this time to invest in yourself, learn an in-demand skill, and earn a prestigious certificate. Avail an exclusive Rs. 250 off along with 55% discount on all online trainings only through my link here –
https://internshala.com/i/TC-ISP23NAVN9380
Due to this lockdown we all have faced many issues and major impact is on our education. I am also an engineering student and I know how much value these certifications and internship will add to your resume.
Today to get placed in a good company you will need to have certifications, internship experience, and Industry level knowledge about what you learn. So do checkout the courses above it might help you a lot. After completing the courses, you can apply for an internship on Internshala.
Internshala is the world's largest internship platform with over 80,000+ companies, 600,000+ internships and 5000,000+ student users.
And the best part is all companies except the NGO’s NTO’s come with stipend and certificates.
#include<bits/stdc++.h>
using namespace std;
int dfs(vector<vector<char> >& grid,int i,int j)
{
if(i<0 || i>=grid.size() || j<0 || j>=grid[i].size() || grid[i][j] == '0')
return 0;
grid[i][j]='0';
dfs(grid,i+1,j);
dfs(grid,i-1,j);
dfs(grid,i,j+1);
dfs(grid,i,j-1);
return 1;
}
int numIslands(vector<vector<char>>& grid) {
if(grid.empty())
return 0;
int islands=0;
for(int i=0;i<grid.size();i++)
{
for(int j=0;j<grid[i].size();j++)
{
if(grid[i][j] == '1')
{
islands+=dfs(grid,i,j);
}
}
}
for(int i=0;i<grid.size();i++)
{
for(int j=0;j<grid[i].size();j++)
{
cout<<grid[i][j]<<" ";
}
cout<<endl;
}
return islands;
}
int main()
{
int n,m;
cin>>n>>m;
vector<vector<char> >grid;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cin>>grid[i][j];
}
}
int count = numIslands(grid);
cout<<count<<endl;
}
