2000. Reverse Prefix of Word Обновлено: 2024-03-12 1 мин Algorithms , LeetCode СодержаниеLeetCode problem 2000class Solution: def reversePrefix(self, word: str, ch: str) -> str: i = word.find(ch) return word if i == -1 else word[i::-1] + word[i + 1 :]