Ad
  • Default User Avatar

    OP solved the kata

  • Default User Avatar

    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 a print 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).

  • Custom User Avatar

    The return print(answer) is wrong, and makes your solution return wrong answers.