This means your code is not optimal enough.
When you press "Run tests", you run the simple tests, which are editable.
When you press "Submit", you run the validating tests, which you cannot edit and which may be quite heavy. If you get the 6000ms error, your code is just too slow, and you have to refactor it so it manages to run the submission tests within 6 seconds.
By the way, you probably use an exponential algorithm to get your result and therefore have O(2^n) instead of O(n).
I can't say better:-)
This means your code is not optimal enough.
When you press "Run tests", you run the simple tests, which are editable.
When you press "Submit", you run the validating tests, which you cannot edit and which may be quite heavy. If you get the 6000ms error, your code is just too slow, and you have to refactor it so it manages to run the submission tests within 6 seconds.
https://github.com/Codewars/codewars.com/wiki/Error-messages:-Submission-timed-out#huh-it-says-now-process-took-more-than-6000ms-did-they-change-the-message