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 / sourabh bose
int countX=0;
int countY=0;
string tmp=x;
for(countX=1;countX<=x.lenth();countX++)
{
for(countY=1;countY<=y.length();countY++)
{
if x.substring(1,countX).Equels(y.substring(1,countY)
{
tmp=tmp.Replace(tmp.substring(1,countX),"");
}
}
}
x=tmp;
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is difference between polymorphism and inheritance?
Are polymorphisms mutations?
What is polymorphism and example?
What does and I oop mean in text?
How Do you Code Composition and Aggregation in C++ ?
Why is object oriented programming so hard?
What is protected in oop?
What do you mean by Encapsulation?
what is the sylabus for priliminaries?
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is debug class?what is trace class? What differences are between them? With examples.
How to hide the base class functionality in Inheritance?
Why is abstraction used?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
How long to learn object oriented programming?