13174 - GEC1506-eliminate duplicated characters   

Description

Given a list of string elements, remove duplicated characters for each string element.

Input

The input consists of two lines:

  1. A list of string elements presented in the one-line text with each element separated by a special separator string
  2. The separator string

You need to remove the duplicated characters in each element. (Case insensitive)

For example, in the sample input,

  1. There are duplicated c in the first element Ericc, it should be modified as Eri.
  2. For element rRita, the r is duplicated with R, it should be modified as ita.

Note that you can use lower() in python to help you to check the characters.

text = "Ericc"

text_lower = text.lower()

print(text_lower) # "ericc"

To retrieve the character, you can use list index:

print(text_lower[0]) # "e"

Output

Print out a line of elements with duplicated characters of each element removed, where each element are connected by the above separator string in the input.

Note that there will be a new line default by python's print() function. If you are using python's print(), just ignore this line.

Sample Input  Download

Sample Output  Download

Tags




Discuss