165. remove characters

Algorithm

easy  - accepted / - tried

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?

Let's try to solve this problem within 10 minutes.

Discuss(73)