diff --git a/LeetCode/1910._Remove_All_Occurrences_of_a_Substring.cpp b/LeetCode/1910._Remove_All_Occurrences_of_a_Substring.cpp new file mode 100644 index 0000000..e419705 --- /dev/null +++ b/LeetCode/1910._Remove_All_Occurrences_of_a_Substring.cpp @@ -0,0 +1,13 @@ +class Solution { +public: + string removeOccurrences(string s, string part) { + size_t pos; + + while ((pos = s.find(part)) != string::npos) { + std::cout << pos; + s.erase(pos, part.length()); + } + + return s; + } +}; \ No newline at end of file