Skip to content

Commit 4b997db

Browse files
committed
Create file
1 parent 51e9c0b commit 4b997db

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
impl Solution {
2+
pub fn remove_occurrences(s: String, part: String) -> String {
3+
let mut old_len = s.len();
4+
let mut result = s.replacen(&part, "", 1);
5+
while old_len != result.len() {
6+
old_len = result.len();
7+
result = result.replacen(&part, "", 1);
8+
}
9+
result
10+
}
11+
}

0 commit comments

Comments
 (0)