#K69907. Filter Words by Special Characters
Filter Words by Special Characters
Filter Words by Special Characters
You are given a list of words and a string of special characters. Your task is to filter the list and output only those words which do not contain any of the given special characters.
Note: A word is filtered out if any character from the special characters appears in it. If the string of special characters is empty, then all words should be output.
The input is provided via standard input (stdin) and the output should be written to standard output (stdout).
Example:
Input: 5 hello h3ll0 world !world python !@#$%^&*()</p>Output: hello h3ll0 world python
inputFormat
The input consists of multiple lines:
- The first line contains an integer n representing the number of words.
- The next n lines each contain a single word.
- The last line contains a string of special characters.
All input is read from stdin.
outputFormat
Print a single line containing the filtered words separated by a single space. If no words remain after filtering, print an empty line. All output should be written to stdout.
## sample5
hello
h3ll0
world
!world
python
!@#$%^&*()
hello h3ll0 world python