Untitled

 avatar
unknown
c_cpp
3 months ago
228 B
5
Indexable
class Solution {
public:
    string removeOccurrences(string s, string part) {
        int l = part.size();
        while (s.find(part) != -1) {
            s.erase(s.find(part), l);
        }
        return s;
    }
};
Editor is loading...
Leave a Comment