Bharath and his strings
Bharath loves to roam in the campus of NITW and also he is good at problem solving. Pratyush decided to give a problem to Bharath.
Pratyush gives Bharath a list of places inside NITW (each place is represented by some character from 'a' to 'z'). Starting from the beginning, Bharath has to visit all the places in the same order as given in the list.
While roaming Bharath writes the name of a place when he visits it for the first time. At the end of the day Bharat will tell all the distinct places travelled by him during entire day in the order he visited them.
First line will contain T, number of test cases.The description of T test cases follows.
The first and only line of each test case contains a string S (containing only lowercase alphabets).
For each test case print the order of visit of Bharath.
- 1 <= T <= 10
- 1 <= |S| <= 100000
Input: 3 abbcccppf abaabccba ccbaacfddhll Output: abcpf abc cbafdhlAll submissions for this problem are available.
|Tags||cakewalk, himkha_100, nplq2019, string-hashing|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions