• Custom User Avatar

    https://codeforces.com/terms:

    Restrictions.

    You are expressly and emphatically restricted from all of the following:
    selling, sublicensing and/or otherwise commercializing any Website material;

    Codewars may be free ( as in beer ), but that does not mean it's not commercial.

    That means any text or code you lifted from Codeforces cannot be used here.
    The task itself is probably generic enough that is is uncopyrightable.

    You should not shout out to Codeforces in the description;
    you should write your own description text that does not even resemble theirs; and
    you should write all your own code from scratch.

    Please close this issue with an explicit message that you have tried to the best of your ability to not use anyone else's IP.

    Note that I am not a Codewars or Andela employee, and certainly not a lawyer.

  • Custom User Avatar

    That's an issue, not a suggestion, and it's documented here.

    Please read all applicable documentation, and test suites of your solved kata, and learn from that. ( If you solve more kata before publishing your own first kata, you could probably learn more from them. )

  • Custom User Avatar

    All the issues actually mean I like the kata and think it's worth fixing.

    I checked; it's not a duplicate unless you start requiring the performance to solve this.

    Deciding whether you want https://www.codewars.com/kata/reviews/6878d857df9d7a7bc5db625f/groups/687a350c17df87835895859e or https://www.codewars.com/kata/reviews/6878d857df9d7a7bc5db625f/groups/6878e401290937e7b94a719b to be a solution is up to you, but you will have to specify, and tailor the test sizing to, that decision.

  • Custom User Avatar

    Do not use the legacy test framework. Use Chai.

    Also, do not console.log anything in testing, use headers and/or failure messages.

  • Custom User Avatar
    function subsetSumInArray(_,n) { return n ? -1 : [] }
    

    This is currently a valid solution, because the validation doesn't check if a -1 return is actually valid.

    If a solution exists, -1 should not be accepted as valid.

    Not marking this as a spoiler, because it should very much be fixed before the kata is republished.

  • Custom User Avatar

    The input domain is either too small or too big.

    If you want a kata that can be solved somewhat naively, length 30 is too big.
    If you want a kata that requires a clever solution, up to 30 is not big enough.

    Runtimes currently vary too much, depending on the max length randomly chosen, so there are too few random tests as well and lengths are too random.

  • Custom User Avatar

    Returning inconsistent datatypes is not a best practice. If no subset exists, ask for null instead of -1 ( it's not an array either, but it's less bad as an optional array value ).

  • Custom User Avatar

    Needs fixed tests with empty array, with tot = 0, and with both. At least one accepted solution returns a wrong answer for that.

  • Custom User Avatar

    thank you! :)

  • Custom User Avatar

    Also, you might wanna search it up on wikipedia, if you don't succeed yourself. There's a nuance that could potentially not let you pass.

  • Custom User Avatar

    O(n*sqrt(n)*m) per entire test suite, where m is the number of tests isn't supposed to pass. Gotta reduce this somehow. Remember about the upper bound.

  • Custom User Avatar

    while my code is correct, i keep failing at test 10# on timeout.
    is O(n*sqrt(n)) supposed to be good enough?

  • Custom User Avatar

    Random inputs are now guaranteed to consist of positive numbers.

    It is theoretically possible for a random input to be [ 1 ], in which case closureGen([ 1 ])[999] is tested against undefined. This makes sense in the language; I'm not preventing this degenerate case.

  • Custom User Avatar

    "Your task is to write a generator function that generates the members of the closure of any given finite set of positive numbers S in ascending order."

    Yes, 0 is to be excluded. I'll fix it.

  • Custom User Avatar

    The starting set generated in the random tests can include 0n, and when that happens, refClosureGen() generates only 0n values.

    For example, take(10)(refClosureGen([3n,2n,0n])) yields [0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n, 0n ] instead of [0n, 2n, 3n, 4n, 6n, 8n, 9n, 12n, 16n, 18n].

    The random tests in the Haskell version does not include zero in the starting set.

    If zero is to be exculded from the starting set, I believe range(1e4) should be changed to
    range(1, 1e4, 1) in the random tests.

  • Loading more items...