You are given a string s and a character ch. Your task is to remove all occurrences of the given character from the string. Loops or built-in replace functions are not allowed. Return the final string after removal.
Example 1
Input: s = "banana", ch = 'a'
Output: "bnn"
Explanation: All occurrences of 'a' are removed from the string.
Example 2
Input: s = "hello", ch = 'l'
Output: "heo"
Explanation: Both 'l' characters are removed.
Example 3
Input: s = "abc", ch = 'x'
Output: "abc"
Explanation: The character is not present, so the string remains unchanged.
Sign in to write, run, and submit your solution against the full test suite.