IBM HACKERRANK CODING SOLUTIONS
الذهاب إلى القناة على Telegram
We provide help for all Exams... Anyone can contact me @AK_Coder for Exam clearance and interviews Trusted ✅
إظهار المزيدلم يتم تحديد البلدالفئة غير محددة
4 420
المشتركون
لا توجد بيانات24 ساعات
لا توجد بيانات7 أيام
لا توجد بيانات30 أيام
أرشيف المشاركات
Chintu, your message was hidden, links not allowed in this group.
#include <iostream>
using namespace std;
int main()
{
int N,H;
cin>>N;
int a[N];
for(int i=0;i<N;i++){
cin>>a[i];
}
cin>>H;
int alive=0,dead=0;
while(H--){
int alive=0,dead=0;
for(int i=0;i<N;i++){
int left=i-1,right=i+1;
if(left==-1 && right==N){dead=0;alive=0;break;}
if(left==-1){if(a[i+1]==0) a[i]=0;else a[i]=1;}
if(right==N) {if(a[i-1]==0) a[i]=0;else a[i]=1;};
if(a[left]==a[right]) {a[i]=0;dead++};
else {a[i]=1,alive++;};
}
}
cout<<"Live:"<<Alive<<" "<<"Dead:"<<Dead;
return 0;
}
✅TODAY ALL SLOTS INFOSYS AND TCS SOLUTIONS GROUP
ALL students gathered at one channel for mutual help
/@coding_solution_help
/@coding_solution_help
/@coding_solution_help
/@coding_solution_help
/@coding_solution_help
/@coding_solution_help
/@coding_solution_help
I have extended education in btech bro is eligible for tcs bro what reason I can told bro plss tell me anyone ?? Pls
