Ad
  • Custom User Avatar

    Do not print the result, return it instead (read this)

  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

    A naive solution has the advantage of being easily parallelized. Do you know how many cores are available?"

  • Custom User Avatar

    if i optimize it even more then i have to write it on bite level that's my limit so no

  • Custom User Avatar

    You do.

  • Custom User Avatar

    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.

  • Default User Avatar

    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."

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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

  • Default User Avatar

    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...