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


Please Help Members By Posting Answers For Below Questions

what is graphics

2202


What is overloading in oops?

820


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2194


What is polymorphism what is it for and how is it used?

752


Is this job good for future? can do this job post grduate student?

1900


what type of questions

1879


How many human genes are polymorphic?

768


What is an advantage of polymorphism?

811


What is interface? When and where is it used?

1865


Plese get me a perfect C++ program for railway/airway reservation with all details.

3642


Explain the advantages of inheritance.

854


What is the diamond problem in inheritance?

803


officer say me - i am offered to a smoking , then what can you say

1828


What is encapsulation example?

748


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).

1885