Marks :10
: 3 | : 0
Given two string S and T, you don't want T to occur as a subsequence in S. For this, you can reshuffle the characters of S in any order you like.
After you do so, you need to tell where there exists a string S' (which is created by shuffling characters of S) which does not contain T as a subsequence.
If there exists such a shuffled string, print "YES", else print "NO" (without quotes).
The first line contains Q, the number of test cases (1 <= Q <= 1e5).
The first line of each test case contains S (1 <= |S| <= 1e5).
The second line of each test case contains T (1 <= |T| <= 1e5).
Both the strings consists of only lower case latin letters.
Print "YES", if S' can be found, else print "NO"
2 abcd abcd aaaa aaa
YES NO
In the first case, S' = "bacd"
In the second case , we can't find any such S'.
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.