← ALL NOTES
String

1910. Remove All Occurrences of a Substring

Given s and part, repeatedly delete the leftmost occurrence of part in s until none remain; return the result. The subtlety: each deletion can splice neighbouring characters into a new occurrence, so…

Loading…