You should not bake hand literal strings in your logic; instead refer to your constants or better yet an Enum
You should try to reduce the amount of class state floating around. index and current_hand for instance are not good class members; instead they should just be local variables.
Consider refactoring your Player class to be an iterator over its hands, ...
I see three ways to improve your runtime. I have never done this problem so I can't guarantee that it will be enough to pass all the tests.
The leaderboard scores are sorted in decreasing order. Your duplicate-removal code converts a sorted list to a set to remove duplicates (O(n)), then converts it back to a list (O(n)), then sorts it (O(n*log(...
I submitted your first code there and got this failure message:
seq_mining(['ABCD', 'ABABC', 'BCAABCD'], 0.34, 1000000) is too slow (took 4.203785117715597s).
Seeing that 1000000 is far larger than useful, I reduced it to the largest actual string length by adding this at the top of your function:
max_int = min(max_int, max(map(len, data)))
grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command g/re/p (globally search for a regular expression and print matching lines)
So your second grep implementation really actually isn't one at all. Disqualified, case closed.
You should use re.escape(...) in the first version, to match behaviour of the second. Without it, special characters in word could be interpreted as regex patterns.
Catching IndexError only ensures the user has given enough arguments; it does not protect against too many. grep.py hello world file.txt will search file world for the word hello, if it exists, ...
Supplement to Maarten Fabré's answer:
We don't even need to remember largest_divisor, as we can simply use value itself. When the current prime being considered is too large to be a factor of value, just return value:
for prime in prime_generator():
while value > prime and value % prime == 0: