3174-clear-digits

DevGod
Vtuber
/** * @param {string} s * @return {string} */var clearDigits = function(s) { while(/.[0-9]/.test(s)){ s = s.replace(/.[0-9]/,''); } return s;};
class Solution: def clearDigits(self, s: str) -> str: dq = deque() for blah in s: if blah.isdigit(): dq.pop() else: dq.append(blah) return ''.join(dq)