-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_character.cpp
More file actions
46 lines (37 loc) · 979 Bytes
/
Copy pathremove_character.cpp
File metadata and controls
46 lines (37 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//https://practice.geeksforgeeks.org/problems/remove-character3815/1/?problemStatus=solved&page=1&query=problemStatussolvedpage1
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for c++
class Solution {
public:
string removeChars(string string1, string string2) {
// code here
int flag;
for(int i=0;i<string1.size();i++){
flag=0;
for(int j=0;j<string2.size();j++){
if(string1[i]==string2[j]){
flag = 1;
}
}
if(flag!=1)
cout<<string1[i];
}
}
};
// { Driver Code Starts.
int main() {
int t;
cin >> t;
while (t--) {
string string1,string2;
cin >> string1;
cin >> string2;
Solution ob;
cout << ob.removeChars(string1,string2) << endl;
}
return 0;
}
// } Driver Code Ends