Ad
  • Custom User Avatar

    Hi Sandro, I've updated this problem to fix some background loading that should make it harder to timeout. Did you want to have another go?

  • Custom User Avatar

    Hi Voile, I've added a random rotation to increase the number of permutations, but its difficult to generate tests on the fly for this. Generating a puzzle that has a guaranteed single solution can take considerably longer than solving the problem, and it could add inconsistent timeouts to the problem.

  • Custom User Avatar

    The problem comes from your code. You are casting a negative number to usize, which results in a really big unsigned number. And then you use this number as the bound in a loop in which you allocate memory, hence the allocation failure.

    Return null/nil/None/... if the input is an even number or negative, as it is not possible to print a diamond of even or negative size.

  • Custom User Avatar

    My Rust solution should work, but adding the appropriately placed newline characters gives this result. This only pops up when the answer is correct - if I add a newline character at the start of the string, the test fails and no error occurs.

    memory allocation of 9223372036854775806 bytes failed

    Caused by:
    process didn't exit successfully: /workspace/target/debug/deps/challenge-07bd72047d917620 --show-output -Z unstable-options --format json (signal: 6, SIGABRT: process abort signal)

  • Custom User Avatar

    Kata only provides a fixed set of test cases, which is easy to hard-code.

  • Custom User Avatar

    https://github.com/MoonPresident/Latin-Square-Generator

    Calling "generate_latin_square" will generate a solution, and calling "cull_latin_square" will generate a problem. Passing the solution into "get_tower_clues" will give you the hints that surround the problem.

  • Custom User Avatar

    Incidentally, I have updated the code to go up to 15x15.

  • Custom User Avatar

    Sorry for the late reply. I currently have no plans to publish a python version, but if you have a python version that works, I'd be happy to work with you on the translation. I can provide you with some test cases if you would like.

  • Custom User Avatar

    I have updated the encoding to reduce the nesting by another layer and included much harder problems. Up to 15 x 15 now!

  • Custom User Avatar

    Count of permutations? How do you mean? This is designed to use skyscaper problems with only one solution.

  • Custom User Avatar

    Hey.
    Yes. It is a good improvement. But in current problems count of permutations too low. The most of test cases get solved after excluding wrong combinations.

  • Custom User Avatar

    Hey Crastinus. Thank you for the feedback.

    You reminded me I had meant to update this task for a while, so I have rewritten the test cases to extend up to 15x15 and to improve the difficulty. Could you have another go and tell me if its a meaningful improvement?

  • Custom User Avatar

    Too easy task. All test cases fits into 30ms in Release buld.

  • Custom User Avatar

    I tried to reproduce, but of all the clues, none of them equal all zeroes. So I'm not sure what the issue was you encountered.

  • Custom User Avatar

    I can confirm it can be solved.

  • Loading more items...