leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1910.cpp (232B)
0 class Solution { 1 public: 2 string removeOccurrences(string s, const string &part) { 3 for (int pos = s.find(part); pos != string::npos; pos = s.find(part)) 4 s.erase(pos, part.size()); 5 return s; 6 } 7 };