Ad
  • Custom User Avatar

    OP solved it, closing

  • Custom User Avatar
  • Default User Avatar

    also same. standard tests all going trough but with random i always have ERROR as a result

  • Custom User Avatar

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

  • Custom User Avatar

    Nice Solution, I would have to look at the other methods added with Java 11.

  • Custom User Avatar

    If there wasn't a pattern, you would have to iterate all of them like you started doing in the code sample.
    I could tell you what the pattern is, but discovering it and translating it into code is where the fun in this kata is at.
    You should get started in looking for a pattern by ouputting the first few numbers in binary (for example, 0..15), leftpad them with with 0's to make 4 bits -- then see if you can recognize the pattern.
    Happy hunting.

  • Custom User Avatar

    I am sorry about your experience with this kata. My intent in this kata was to require some algorithm design thought beyond the "simple decrement and check-the-digits" kinds of implementations that I intended to weed out through them taking too long to run. I looked at the top-rated javascript solution and realized that they got away with precisely this kind of inefficient solution I wanted to prevent. So it's clear that my big-random-number acceptance tests must be flawed. With randomized data, some kata can be completed by simply resubmitting and getting lucky with the new randomized test cases.

    Regardless, I left a comment on their solution and will probably write a new performance version of this kata that ensures that such solutions will fail. I have other ideas about how to thwart such solutions, however, had I generated a number like: 900000001 (900 million + 1). The next smaller number with the same digits is: 190000000 (i.e., 190 million) -- a decrement-and-check-digits approach will have to spin through nearly 710 million numbers that do not have the same digits to find in order to find this one.

    The other sites you mention must include a similar 'your algorithm took too long to run' timeout (that may be longer than code wars' 12 seconds); otherwise, they are vulnerable to a runaway infinite loop taking down their services.

    Since your solution timed-out, you could post it here if you like, and I will be happy to review it. You can mark it as a spoiler, if you like -- to keep from giving hints away to others that haven't solved it yet.

    Thanks,

  • Custom User Avatar

    getting stuck here... can anyone help me where i am getting it wrong

    random tests : expected:<E[RROR]> but was:<E[STABLISHED]>

    fixed tests : expected:<[ERROR]> but was:<[FIN_WAIT_1]>

  • Custom User Avatar

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

  • Custom User Avatar

    I can't know what you're doing wrong without seeing the code

  • Custom User Avatar
  • Custom User Avatar

    Or you can look at this the other way around: they spoonfeed you at every moment...?

    I agree there are a lot of poorly described problems on cw, but that's not the case for this one, even if it's effectively rather minimalist. The idea here isn't to provide the algorithm to you, it's up to you to identify it. If you carefully study the example of the description, you should see that it can answer to all the questions about what you should do in what case.

  • Custom User Avatar

    please atleast explain the problem statement clearly with more examples. How its been processing. This is an example of bad problem statement. This is the problem with codewars, something topcoder, codechef & hackerrank does it very good.

  • Custom User Avatar

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

  • Custom User Avatar

    you should always specify the constraints regarding each question, something which topcoder does brilliantly.

    1. How much commentSymbols can be passed ? is it always 2 or may vary ?
    2. what symbols can be passed probably like always special characters or other than that.
    3. does string always include newline character ?

    also the question doesn't clearly well stated. Its so confusing becus of that, we need to take care of every boundary conditions which makes us to ask such questions.

  • Loading more items...