Ad
  • 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"
    
  • 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.