Convertible string
Submissions: 735   Accuracy:

35.82%

  Difficulty: Easy   Marks: 2

Given two strings check whether first string could be converted to the second string but the conditions are:

1.If the character is at odd place you can swap this character with the characters only at the odd places in    the given first string.
2.If the character is at even place you can swap this character with the characters only at the even places      in the given first string.
3.You cannot insert or delete any character on your own.

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of two string x and y.

Output:
If string x could be converted to string y then print "1" otherwise print "0".

Constraints: 
1<=T<=200
1<=|Length of strings|<=1000

Example:
Input:

2
geeks for
skeeg geeks

Output:
0
1

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

Contributor: Saksham Ashtputre
Author: saksham0751


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.