13176 - GEC1506-eliminate unwanted elements   

Description

Given a set of elements and another set of unwanted elements, remove the unwanted elements.

Input

There are two lines for the input, which are

  1. The set of elements
  2. The set of unwanted elements

e1 e2 e3 ... en                <--- elements 1~n

u1 u2 ... um                   <---- unwanted elements 1~m

Note that

  1. Each element is separated by a SPACE token.
  2. You need to remove the elements e which also exist in u. (Case sensitive)

Hint: You can use an index to find an element in a list

elements = [1, 2, 3]

print(elements[1]) # 2

Output

Print out a line of elements with unwanted elements removed, where each element are connected by a SPACE token (" ").

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