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 destructor oops?
What is overriding vs overloading?
Is this job good for future? can do this job post grduate student?
What is variable example?
What are objects in oop?
Can we define a class within the interface?
Can we have inheritance without polymorphism?
What is multilevel inheritance?
How do you use inheritance in unity?
Why is abstraction needed?
What is and I oop mean?
What is encapsulation c#?
What are classes oop?
What are the 3 pillars of oop?
What is difference between data abstraction and encapsulation?