๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.7K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
Ivykids (formerly Yellow Class) hiring a Mernstack developer to join our tech team!

PS - 2023 B.tech batch students are most welcome!

Location - Work from office, Gurgaon.

Interested candidates can share their updated CV at deepanshi@ivypods.com to proceed ahead with the selection process.
int helper(string a,string b){
    int i,j,n=a.size();
    if(n!=b.size())return -1;
    int ans=0,cnt=0;
    for(i=0;i<n;i++){
        if(a[i]==b[i] && a[i]!='?')return -1;
        if(a[i]=='?' && b[i]=='?'){
            cnt++;
            continue;
        }
        if(b[i]=='?'){
            if(a[i]=='W')b[i]='R';
            if(a[i]=='R')b[i]='W';
            ans++;
        }
        if(a[i]=='?'){
            if(b[i]=='W')a[i]='R';
            if(b[i]=='R')a[i]='W';
            ans++;
        }
    }
    int w=0,r=0;
    for(i=0;i<n;i++){
        if(a[i]=='W')w++;
        else if(a[i]=='R')r++;
    }
    int x=abs(w-r);
    // cout<<x<<" "<<cnt<<endl;
    if(x<=cnt)ans+=(2*x);
    else return -1;
    return ans;
}

American Express (Balance the Board)
#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,u,l; cin>>n>>u>>l;
    vector<int>a(n);
    for(int i=0; i<n; i++) cin>>a[i];
    vector<vector<int>>v(2, vector<int>(n,0));
    for(int i=0; i<n; i++){
        if(a[i]==2){
            v[0][i]=1;
            v[1][i]=1;
            u--,l--;
        }
    }
    for(int i=0; i<n; i++){
        if(a[i]==1){
            if(u>0){
                u--;
                v[0][i]=1;
            }
            else{
                v[1][i]=1;
                l--;
            }
        }
    }
    for(int i=0; i<2; i++){
        for(int j=0; j<n; j++)
        cout<<v[i][j]<<" \n"[j==n-1];
    }
}

American express 2nd(by John)