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 graphics
What is overloading in oops?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
What is polymorphism what is it for and how is it used?
Is this job good for future? can do this job post grduate student?
what type of questions
How many human genes are polymorphic?
What is an advantage of polymorphism?
What is interface? When and where is it used?
Plese get me a perfect C++ program for railway/airway reservation with all details.
Explain the advantages of inheritance.
What is the diamond problem in inheritance?
officer say me - i am offered to a smoking , then what can you say
What is encapsulation example?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).