From 52595fd2a9255ea5db9b53dc37c36ab532bebabf Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:47:32 +0530 Subject: [PATCH] Create 1910. Remove All Occurrences of a Substring --- 1910. Remove All Occurrences of a Substring | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 1910. Remove All Occurrences of a Substring diff --git a/1910. Remove All Occurrences of a Substring b/1910. Remove All Occurrences of a Substring new file mode 100644 index 0000000..b4de43a --- /dev/null +++ b/1910. Remove All Occurrences of a Substring @@ -0,0 +1,15 @@ +class Solution { +public: + string removeOccurrences(string s, string part) { + int n = part.length(); + string ans; + for(char c: s){ + ans.push_back(c); + while(ans.find(part) < ans.length()){ + for(int i = 0;i