HF RL Explorer

Task: Find All Occurrences of a Substring in Python

Task: Find All Occurrences of a Substring in Python: a task in Terminal-Lego-15k (Harbor dataset). Python's built-in string.find() method returns the index of the first occurrence of a substring, and string.rfind() returns the index of the last occurrence. However, there is no built-in string.find…

The task

Python's built-in `string.find()` method returns the index of the first occurrence of a substring, and `string.rfind()` returns the index of the last occurrence. However, there is no built-in `string.find_all()` method to return all indices where a substring occurs.

Part of PrimeIntellect/Terminal-Lego-15k.