#K58977. Remove Specific Characters from Strings

    ID: 30762 Type: Default 1000ms 256MiB

Remove Specific Characters from Strings

Remove Specific Characters from Strings

You are given an integer ( M ) and ( M ) pairs of inputs, each consisting of a string and a character. For each pair, remove all occurrences of the given character from the string and output the modified string on a new line. Formally, if a string is denoted by ( s ) and the character to remove is ( c ), the output string is given by: [ \text{output} = s \setminus { c } ] Your task is to implement this transformation.

inputFormat

The input is read from standard input (stdin). The first line contains an integer ( M ) representing the number of pairs. It is followed by ( 2 \times M ) lines. For each pair, the first line is a string (which may include spaces) and the second line contains a single character which needs to be removed from the string.

outputFormat

For each of the ( M ) pairs, output the modified string on a separate line to standard output (stdout), where all occurrences of the specified character have been removed. If the string becomes empty after removal, output an empty line.## sample

3
hello
l
banana
n
test
t
heo

baaa es

</p>