diff --git a/text.py b/text.py index 4ca69fd..05b8f09 100644 --- a/text.py +++ b/text.py @@ -132,7 +132,7 @@ def find_nth_occurrence(string: str, substring: str, n: int): else: rep = "b" * len(substring) - return string.replace(substring, rep, n - 1).find(substring) + return string.replace(substring, rep, n).find(substring) if __name__ == "__main__":