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.
Do not print the result, return it instead (read this)
Ideally, requirements should be roughly the same in different languages, but it's not perfect science and it's not always easy to adjust. The framework makes a code time out when it doesn't pass all the provided tests in 12 s, that's all. Here it seems clear: to pass the tests, the user must provide a solution with a linear complexity.
The full test suite has dozens of tests with up to 60000 elements per array, so unless you're testing like this locally, your less than one second runtime isn't really comparable. If you're asking about parallelization, you're going down the wrong road for this kata.
Is it reasonable to assume that the same timeout applies to a kata for all programming languages, or does each kata have an individual timeout depending on the programming language? I suspect that the same timeout applies to all languages for each kata.
A naive solution has the advantage of being easily parallelized. Do you know how many cores are available?"
if i optimize it even more then i have to write it on bite level that's my limit so no
You do.
An easy-to-understand and simple program is always preferable in practice over a fast program, right? -> No, clearly, no. Please forget this readable and easy programs belief. What would you say about a GPS needing 4 hours to compute a single traject because it priorizes simplicity in its programs?
You have the right to be interested in implementing poor algorithms, but then please don't complain that your code doesn't pass the tests. Focus on katas that don't have performance requirements and leave the rest.
An easy-to-understand and simple program is always preferable in practice over a fast program, right?
Should we really write program code that no one is willing to modify?
How the solution with good runtime performance (e.g., less than 10 milliseconds) looks like is quite clear. BUT: To explain this solution to someone, it takes a few minutes. So, compare 10 milliseconds to a few minutes."
This comment is hidden because it contains spoiler information about the solution
Your solution has a bug and it is not a kata issue.
Please run following line of code in your IDE:
print(f"My solution for n=4 is:\n{generate_shape(4)}")
and tell us the output.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
No, your function should return a string, not print several to the console. Fix your code.
And read this: https://docs.codewars.com/training/troubleshooting/#expected-the-same
I think it was pretty good because although not very intuitive or forgiving it forces you to really think about how you're going to solve the problem.
Loading more items...