Ad
  • Custom User Avatar

    If you don't specify a language, answering your question is impossible. Help us help you!

    But, have a look at the number of solutions for your particular language. All languages have multiple solutions, some numbering in the thousands.

    Notes:

    • Performance needs to be considered

    Also, performance and optimization tags.

    It seems highly unlikely the problem is with the kata or the platform. It seems highly likely it's with your code. Which makes this not an issue.

    Your O(2n) claim is impossible to evaluate without your code ( and would normally be written O(n) because constants are uninteresting in this context ).

    Closing.

  • Default User Avatar

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

  • Custom User Avatar

    I agree. It fails on sample tests, but it passes when hitting submit. Any suggestions on how to remove it? Codewars isn't clear on how something like this is resolved.

  • Default User Avatar

    Why is this here? It is not a working solution. Just ran it into the sample test and the output is:

    12345
    6