Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
OP solved the kata
Hi @Bodeq - the error that you encounter
Max Buffer Size Reached (1.5 MiB)
is not due to your algorithm, it is simply due to the fact that you have aprint
statement:print('element a/',i ...
<- in your main code.Codewars test framework stops due to "Max Buffer Size Reached (1.5 MiB)" - because with large tests your code will
print
a huge amount to console.Just remove this line (or comment it) from your code and you should avoid this error (now your code should be able to run up to the full
12
seconds allowed for the tests in Python).The
return print(answer)
is wrong, and makes your solution return wrong answers.