Ad
  • Custom User Avatar

    Fixed tests are not future-proof: it will break after 2034.

  • Custom User Avatar

    Initial code has duplicate param day.

  • Custom User Avatar

    no novelty in task, no random tests, author long gone

  • Custom User Avatar

    Not an issue?

  • Custom User Avatar

    It really depends on your logic. Not all ways of doing this add both divisors to the array. i.e. when getting factors of 72 and you are testing 2, not all algorithms will also add 36 in the same iteration. If you take a functional approach such as filtering a range of 2..x, x needs to be the initial input divided by 2. If you are looping and adding both divisors, then square root works fine.

  • Custom User Avatar

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

  • Custom User Avatar

    FYI - You can split using a regex rather than doing a replace + split.

  • Custom User Avatar

    Instructions and tests didn't specify, but I assumed we couldn't use the first word unchanged. What happens with this test:

      assert to_camel_case("fIrSt-word") = "firstWord"
    
  • Default User Avatar

    @unclesnottie spoke - I think - about Elixir. In Elixir curly braces don't denote sets but tuples (tuples are ordered). There are many languages in this kata and few languages share the same notation for sets, arrays, tuples, pairs and so on. The aim of the kata is not to return a set but to return according to each language an array of arrays or of pairs or a list of pairs , of tuples or etc...
    I hope the author don't confuse them:-) but it might be possible. Have a look at the description and you will see many notations. I understand that one can be a bit confused, you included:-)

  • Custom User Avatar

    Technically, yes. The use of curly brackets is misleading here (and in my opinion should be omitted, if anything, only the returned object should be possibly considered a set). The description asks for all tuples (a, b), but obviously those tuples also imply (b, a).

    In other words, yes. {15, 21} is the same as {21, 15}, but ((15,21), (21,15)) and {(15, 21), (21, 15)} are perfectly valid notations. It seems the description does not make a distinction between these brackets - which may lead to confusion.

    Under normal circumstances, curly brackets denote a set. In this case, the author appears to confuse the two.

  • Custom User Avatar

    Why wouldn't the return value for: removNb(26) should return [ {15, 21}, {21, 15} ] simply be [ {15, 21} ]? Mathematically speaking the set of {15, 21} is the same as the set of {21, 15}.

  • Custom User Avatar

    I think this Kata needs a test where m == n. Such as testing(37, 37, 37, [["M: 37", "B: 5", "C: 4"]]). I only mention this because the top solution in Elixir is currently wrong for this test.

  • Custom User Avatar

    I don't think you need the def howmuch(n, n), do: [] part. I used Stream.filter_map and the case for m == n works. It may look like an optimization, but actually it is wrong. Try adding a test testing(37, 37, 37, [["M: 37", "B: 5", "C: 4"]]). I think the author should add such a test.

  • Custom User Avatar

    Draw a picture and add stuff up by hand. It's much easier then.