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
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment