Ad
  • Custom User Avatar

    I disagree. The part

    n being given (n integer, 1 <= n <= 50) calculate enum(n) i.e. the partition of n

    is given just to explain the tests procedure. Those who in your opinion don't calculate the partitions explicitely calculate them anyway, because I am very doubtful you can pass the tests without calculating the partitions. Otherwise I think you can publish an article about it :)

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

    It depends whether you call some spaces part of a column or part of a column separator. Some parts of this kata are tedious. Only by working through examples, the intricacies of the spec become fully clear.

  • Custom User Avatar
  • Custom User Avatar
    • for n > 8 — it must not exceed 3.5 · n · log2(n).

    log in what base? Natural log, log 10, and log 2 differs by a factor of more than 2, which is pretty significant there.

  • Custom User Avatar

    This is the point I tried to make in the other post. Enforcing tight restrictions just greatly limits the range of potential solutions. If the kata was based on a unique algorithm (ie. not available on wikipedia) then that might be a fine approach, to make it more difficult and put it at a lower kyu rank. But that's not the case, so you aren't increasing difficulty, you are just encouraging more people to google it, making this less interesting.

  • Default User Avatar

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

  • 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 is mainly because the sorting network algorithm I used doesn't generate a lower bound as low as the algorithm you chose.
    Nonetheless, the algorithm I chose is a legit solution for the general case and I had to treat n <= 8 as a special case.

    Unless you want to enforce only one algorithm - and in such case it has to be mentionned in title or description, you should accept all correct algorithms as valid solutions and thus you should drop the n <= 8 condition.

  • Custom User Avatar

    I think you are missing my point. I agree with you that finding algorithms yourself is much more fun than just finding it online, but the problem is that currently it is much easier to find it on wiki, than to figure it out yourself. And a kata cannot be given a difficult rank, if such an easy solution exists.

    Which is why I suggested those things. You don't have to add anything to the description if you want, but if you remove the n <= 8 extra condition, and make the other one slightly easier, then more people will be able to solve it on their own.

  • 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

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

  • Default User Avatar

    Hardcoding swaps for n <= 8 brings nothing to the kata, it is advised to remove it.

  • Loading more items...