#C14993. Remove Character and Count
Remove Character and Count
Remove Character and Count
You are given a string \( S \) consisting solely of uppercase English letters and a character \( C \). Your task is to remove all occurrences of the character \( C \) from \( S \) and output the modified string along with the number of characters removed.
More formally, let \( k \) be the number of times \( C \) appears in \( S \). Define the new string \( S' \) as \( S' = S \setminus \{C\} \). The program should output \( S' \) in the first line and \( k \) in the second line.
For example, if \( S = \texttt{HELLO} \) and \( C = \texttt{L} \), then the modified string is \( \texttt{HEO} \) and the number of removed characters is 2.
inputFormat
The input is read from standard input (stdin). The first line contains the string ( S ), and the second line contains the character ( C ) to be removed.
outputFormat
Output the modified string on the first line and the count of removed characters on the second line.## sample
HELLO
L
HEO
2
</p>