Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
3,235 views
Link to all the TCS_NQT Coding Questions and Answers of year 2022 : https://www.desiqna.in/tag/tcs_nqt
in Online Assessments by Expert (111,530 points)
edited by | 3,235 views

2 Answers

0 like 0 dislike
Best answer

C++ code : 

#include <bits/stdc++.h>

using namespace std;
typedef long long int ll ; 
int main() {
    string a,b;
    cin>>a>>b ;
    map <char,ll> kk ; 
    ll n = b.size();
    ll i = 0 ; 
    while(i<n){
        char g = b[i];
        kk[g]++;
        i++;
    }
    n = a.size();
     i = 0 ; 
    while(i<n){
        char g = a[i];
        if(kk[g]==0){
            cout<<g ; 
        }
        i++;
    }
    
    return 0;
}
by Expert (111,530 points)
0 like 0 dislike

Code Question Pics : 

by Expert (111,530 points)