LeetCode #1910

Remove All Occurrences of a Substring

1개의 풀이 · Python

문제 원문 보기 ↗

SOLUTION INFO

Python · main.py

main.py
class Solution:
    def removeOccurrences(self, s: str, part: str) -> str:
        while part in s:
            idx = s.find(part)
            s = f"{s[:idx]}{s[idx+len(part):]}"
        return s

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.