1910. Remove All Occurrences of a Substring
https://leetcode.com/problems/remove-all-occurrences-of-a-substring
Description
Given two strings s
and part
, perform the following operation on s
until all occurrences of the substring part
are removed:
Find the leftmost occurrence of the substring
part
and remove it froms
.
Return s
after removing all occurrences of part
.
A substring is a contiguous sequence of characters in a string.
Example 1:
Example 2:
Constraints:
1 <= s.length <= 1000
1 <= part.length <= 1000
s
andpart
consists of lowercase English letters.
ac
Previous1909. Remove One Element to Make the Array Strictly IncreasingNext1911. Maximum Alternating Subsequence Sum
Last updated