Demonitisation
Submissions: 693   Accuracy:

22.43%

  Difficulty: Basic   Marks: 1

Given a String S. Your task is to remove the given two strings(M and N) completely from the given string S. If String is completely removed than print -1.
Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Th first line of input contains a String S. And next line contains two Strings which is to be removed M and N.

Output:
Print the respective output in the respective line.

Constraints:
1<=T<=20
1<=|Length of Strings|<=50

Example:
Input:

3

abc

ab bc

abbbccab

ab bcc

narendramodi

add di

Output:

-1
b
narendramo

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.