Ad
  • Custom User Avatar

    There are 20000 JS tests in total, your code handles about half of them, I have run it several times - the result is 10_000 - 12_000. To be honest, I haven't looked closely at your code and can't tell you exactly what the problem is, but your algorithm needs to be improved. However, before you change anything, maybe you can add caching for some “heavy” calculations (if there are any and it is possible), it might work.

  • Default User Avatar

    I managed, not without difficulty, to find a solution to this Kata!
    But I can't get past the random tests...
    Code Wars gives me a timeout before the tests are finished.
    I didn't use a brute force algorithm; the algorithm solves a puzzle in an average of 1ms, so I don't know what more I can do...
    (Tests done in JS.)

  • Custom User Avatar

    I came back to it a month later, and re-wrote the solution and it worked. Really good Kata

  • Default User Avatar

    How many tests are there in the random tests?

    I have a solution that keeps timing out after about 10,000 tests, and I'm struggling to make it more efficient. There's no brute force in my solution.

    It would be nice to know if it needs to get 10% or 100x more efficient

  • Default User Avatar

    The question I want to ask is, whether this kata can be solved by pure logic instead of relying on algorithms to "try to get" a possible result?
    In the sample test, I tried to use logic to infer the possibility of each cell. The final best result was to identify the leftmost and rightmost cells of the first row as C and E (and I was not sure which was C or E).
    The rest parts can only rely on algorithms, not logic. In that case, I decided to give up.
    If there is a better logical inference, please give me some tips, because I am stupid. O_o

  • Custom User Avatar

    Fixed

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    The Markdown on the Clues section are messed up. They should be fixed ;-)

  • Custom User Avatar

    For a new pple, exceptions should be created outside SoulutionTest.class like a regular multiple classes in one file.

  • Custom User Avatar
  • Custom User Avatar

    "Left of" clues mean that s1 is in any column that is to the left of the colum s3 is in. (I hadn't noticed the example didn't make that clear as both left of clues are to the immediate left, but that is not a constraint). In other words, using A < Q and given that Q is in column 4, then A may be in columns 0,1,2, or 3.

    "Next to" clues mean that the two object are in columns that are directly next to each other. So in the case of AQA and given Q is in column 2, then A must be in column 1 or 3.

  • Custom User Avatar

    Regarding the description; there's some ambiguity, could you clarify the description?

    a. "Left of" clue: "This clue means that s1 exists in a column to the left of the column containing s3 --> This does not mean they are necessarily next to each other"
    Is that the immediate left of the column containing s3, or any column to the left of s3?
    Does "next to each other" mean "next to each other in the same row"?

    b. "Next to" clue: " This clue means that s1 exists in a column next to the column containing s2"
    Does this mean the immediate left or right of the column containing s2, or any column to the left of right of s2 (i.e. "not the same column as s2")?

    Thanks!

  • Default User Avatar

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

  • Default User Avatar

    Did you find the solution/answer for this. I have the exact same question.

  • Loading more items...