Kensorship
https://codeforces.com/group/cRJbcAFEwS/contest/487230/problem/C
Question
Kody desided that the nekst step in eliminating hiram na titik is implementing a tekst pilter to kensor out all their okkurenses in the Abakoda Diskord tsannel. He wants this tekst pilter to habe the pollowing punktionality, and asks you to kode it por him.
A word is a contiguous sequence of upper and/or lowercase English letters (A to Z and a to z). Any other characters are either spaces or punctuation, which are used to separate (or delimit) the different words in a text. To censor a word means to replace it with a number of asterisks * equal to that word's original length (e.g. duck becomes ****). Note that spaces and punctuation should never be included in censorship, as they are not part of a word.
Rather than only censoring hiram na titik, let's make our program a little bit more general. First, you will be given a string describing the set of forbidden letters. Then, you will be given a single line of text, which contains one or more words separated by spaces/punctuation. Censor every word in that line of text that contains a forbidden letter, leaving spaces, punctuation, and non-forbidden words exactly the same.
Input Format
First, a line containing some number of distinct uppercase English letters, describing the set of forbidden letters in this test case. Note that the lowercase forms of these letters are forbidden, too.
This is followed by another line, the text that needs to be censored.
Constraints
At least one letter will be forbidden.
The text will not begin or end with spaces.
There will never be two consecutive spaces in the text.
The text will contain at least one word.
The text will only contain upper and/or lowercase English letters, spaces, and punctuation characters from among
.,?!'-";()
The text will not exceed characters in length (this includes spaces and punctuation).
Output Format
Output the exact same line of text from the input, but having censored all words that contain a forbidden letter.
Sample Inputs:
Last updated