Problem : Beautiful Substring
A string is said to be "Beautiful", if it contains only non repetitive alphabets. Let S be the string with lower case alphabets, your task is to find out the longest "Beautiful sub-string" present in the given string S.
Input Format:
First line starts with T, which is the number of test cases. Each test case contains string S.
Output Format:
Print the first longest beautiful sub string present in the string S.
Constraints:
1<=T<=10
1<=|S|<=5500, S will contain only lower case alphabets.
Sample Input and Output
SNo. Input Output
1
2
ss
abcdeddd
s
abcde
Note:
Please do not use package and namespace in your code. For object oriented languages your code should be written in one class.
Note:
Participants submitting solutions in C language should not use functions from <conio.h> / <process.h> as these files do not exist in gcc
Comments
Leave a comment