Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO
3.37K subscribers
1.13K photos
3 videos
17 files
373 links
Main channel https://t.me/Coding_000
Contact Admin 👉 @ILOVEU_143 for booking your exam slots
Web- https://coding000.github.io/Projects/
💯% clearance in any placement exams
OffCampus -https://t.me/Offcampus_000
Discussion- https://t.me/exams_discussion
Download Telegram
#include <bits/stdc++.h>
using namespace std;

int equalzeroandone(vector<int>v){
    int n=v.size();
    for(int i=0;i<n;i++){
        if(v[i]==0){
            v[i]=-1;
        }
    }
    int sum=0;
    int ans=-1;
   map<int,int>mp;
    for(int i=0;i<n;i++){
        sum+=v[i];
        if(sum==0){
            ans=i+1;
        }
        if(mp.find(sum)!=mp.end()){
            ans=max(ans,i-mp[sum]);
        }
        else{
            mp[sum]=i;
        }
    }
    return ans;
}

int main() {
    int n;
    cin>>n;
    vector<int>v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    cout<<equalzeroandone(v);
}

Equal number of zero
Infosys
👍1
Sending Largest Array with Equal Number of zeroes code

All test Cases Passed

share @coding_000❤️
👍3🔥1
Attention everyone!!

Those who need help for Cognizant, Accenture, CGI or any placement tests clearance should contact @ILOVEU_143👨‍💻😊 and book your slots

100% CLEARANCE 👨‍💻

Remote access available🤞

Telegram: @ILOVEU_143

SHARE @coding_000👨‍💻
👍3😍1
Attention everyone!!

Those who need help for Cognizant, Accenture, CGI or any placement tests clearance should contact @ILOVEU_143👨‍💻😊 and book your slots

100% CLEARANCE 👨‍💻

Remote access available🤞

Telegram: @ILOVEU_143

SHARE @coding_000👨‍💻
👍1👏1
TECH Mahindra Exam

Round 1 & 2

Help available.👨‍💻

100% Clearance GUARANTEE.

Check our past Results. 👇👇

https://t.me/Coding_000/5567?single
https://t.me/Coding_000/5563?single

Contact
@ILOVEU_143
👍3😍1