Ad
  • Default User Avatar

    The kata accepts all correct algorithms, simply by the means this site works. And correct algorithms are those which fulfill all kata's conditions, and the optimality with n<=8 is one of the conditions. If you chosen to split algorithm into two halfs, it's up to you, but there will be people who chose to find a more optimal algorithm and these are why this kata was created. I'm not going to change kata simply because there are alogorithms like yours. There always be algorithms split into 2-3 or even 10 parts.

  • Default User Avatar

    It's yours (the solver) choise how to aproach the kata. You treated n <= 8 as a separate case and hardcoded it, others - did not.

  • Default User Avatar

    I'm sorry, but for me the whole point of the kata is to find the algorithm, it's a lot of fun. The rest is very boring and easy indeed, fortunately it takes 95% to find the algorithm and 5% to code it. There by this kata is created.
    If some people prefer to do it with wiki - I can't help it, but I'm not going to help them either, especially when it comes at the cost of the people I care about - those who enjoy finding the algorithm on their own.

  • Default User Avatar

    I did not :)
    ty. this solves the issue.

  • Default User Avatar

    Hi. Do you happen to know, why I can see "Input correctness tests" section in the example tests when I press edit kata button, but when I press Try again button to solve the kata - i don't see the "Input correctness tests" section, I see the old version of the example tests.

  • Default User Avatar

    ok, i've added input correctness tests to the example tests.

  • Default User Avatar

    Are you talking about the solution you've submitted?
    I can't reproduce the problem.

    The preloaded functions are pretty straightforward. The first one - "sort(instr, shoes)" - it is shown in the description. It would be both misleading and wastefull to add an index check there - tests will run longer.
    The second one is "max_n_instr(n)". It will not fail unless you modify tests to make them try to sort a list with n <= 1 shoes. I will fix it to never fail, good idea.

  • Default User Avatar

    idk, looks much less obscure to me than any 10+ lines solutions. Of course comments would be welcome, but even w/o comments this one takes much less time to read and fully understand.

  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

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

  • Default User Avatar

    I mean in the bounder description it is stated:

    • c1 & b1: carbon and branch number of the first atom

    I c1 is an integer, so read this as

    • c1 & b1: carbon number and branch number of the first atom

    meanwhile carbon number of a molecule (in chemistry) means a total amount of carbons in the molecule.
    carbon number of an atom is either 1 when atom is carbon or 0 when atom is not carbon.

    as far as I can guess from the tests, c1 is the position of the atom on the branch, but it took me a long time to understand. Partially because I didn't see branches as consequtive sequences of atoms and the fact that branches don't have to consist from carbons only, but any kind of atoms can be there and then called "carbon number" c1 would have nothing to do with the actual carbon element.

  • Loading more items...