LeetCodeRemove All Occurrences of a SubstringRemove All Occurrences of a SubstringMediumStringStackSimulationSolution export function removeOccurrences(s: string, part: string): string { let current = s; while (current.indexOf(part) !== -1) { current = current.replace(part, ''); } return current; }LeetCodeRemove All Occurrences of a Substringhttps://leetcode.com/problems/remove-all-occurrences-of-a-substring