Playful String
Practice
1.6 (8 votes)
Easy
Problem
78% Success 1863 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

KillCode is trying to learn strings but failing to solve the recursive approach given by his Teacher. His Teacher gave him a string consisting of lower case alphabetes only , He asked to find a substring in the given string after removing any charaters from the original string . For example if the string is

" Cypher"

and the substring is "yer", Killcode can remove p,h from the string and can form the given substring.

Now the Teacher got impressed from Killcode and decided to increase the difficulty by asking to find the substring and reverse of substring in given string. If both substring can be formed by a given string by removing certain characters , print "GOOD STRING " else print "BAD STRING".

Contraints

1<=t<=10 1<=|s|<=100000

Input -

First line contains integer t denoting the test cases, each test case contains two lines containing two strings.

Output-

Print "GOOD STRING"(without quotes) both strings can be formed by given string else print "BAD STRING".

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
16 votes
Tags:
AlgorithmsString SearchingString Algorithms
Points:20
42 votes
Tags:
Data StructuresEasySortingString Manipulationapproved
Points:20
15 votes
Tags:
AlgorithmsString ManipulationString manipulation
Editorial

No editorial available for this problem.