remove characters
2022年5月1日小于 1 分钟
remove characters
Question
Given a string contaning only a
, b
and c
, remove all b
and ac
.
removeChars('ab') // 'a'
removeChars('abc') // ''
removeChars('cabbaabcca') // 'caa'
What is the time and space complexity of your approach?
Code
/**
* @param {string} input
* @returns string
*/
function removeChars(input) {
// your code here
}