Given two strings like x=?hello? and y=?open?, remove any
character from string x which is also used in string y,
thus making the result x=?hll?.
Answer Posted / vijay bhatia
string processString(string x, string y) {
string res = "";
int occuranceCount[26];
for(int i=0; i<26; i++) {
occuranceCount[i] = 0;
}
for(i=0; i<y.size(); i++) {
occuranceCount[y[i]-'a']++;
}
for(i=0; i<x.size(); i++) {
if (occuranceCount[x[i]-'a'] == 0) {
res += x[i];
}
}
return res;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is html an oop?
write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What is coupling in oop?
What is polymorphism explain?
What is oops and why we use oops?
What is the advantage of oop over procedural language?
What is polymorphism in oop example?
write string class as your own class in java without using any built-in function
What are the components of marker interface?
What are the 3 pillars of oop?
Can we create object of interface?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
What are the types of abstraction?
Can we create object of abstract class?