Make a string from another string
Easy Accuracy: 33.53% Submissions: 601 Points: 2

Given two strings, find if the first string can be made from second by deleting some characters from second and rearranging remaining characters.

Input:
The first line consists of an integer T i.e number of test cases. The first line of each test case consists of string s1. The next line consists of string s2

Output:
If s1 could be made by s2 print "1" else print "0".

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

Example:
Input:

2
Hello
dnaKfhelddf
GeeksforGeeks
rteksfoGrdsskGeggehes

Output:
0
1

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.