leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1910.cpp (232B)


      1 class Solution {
      2   public:
      3     string removeOccurrences(string s, const string &part) {
      4         for (int pos = s.find(part); pos != string::npos; pos = s.find(part))
      5             s.erase(pos, part.size());
      6         return s;
      7     }
      8 };