Ad
  • Custom User Avatar

    Why enumerate the list of directions? You don't make use of the automatic count anywhere.

  • Custom User Avatar

    He not wrong about saying there needs to be more information. this helped me alot

  • Default User Avatar

    I have to concure with j.pihlgren, it is not clear what you are saying at all. If you are going to critique the solution could you please provide a better explanation as to what is expected as what is presented is not clear at all.

    Moving on, failing any solution just because you don't like it limits the creativity of everyone involved including yourself.

    If something solves a problem it is valid, period.

  • 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

    Good question though, I completely overlooked that little piece of information too :-)

  • Default User Avatar

    I found that out as well, just changed the test code to what it should be, but the actual test are broken as well for the last test I get

    returns 'nopqrstuvwxy`abcdefghijklm' should equal 'nopqrstuvwxyzabcdefghijklm'

    and the rules are that any special character should be ignored, but here it is not.

  • Custom User Avatar

    Thank you for the kata. It was a lot of fun. :-)

  • Custom User Avatar

    Within that sequence, he chooses two numbers, a and b

    In your example only 15 and 21 are within 1-26.
    [[1, 175], [3, 87], [7, 43], [10, 31], [31, 10], [43, 7], [87, 3], [175, 1]]: here all numbers like 175, 87, 43, 31 are not within 1-26.
    BTW don't post issue unless you are sure you understood the description. You could post simply as beeing a "Question".

  • Default User Avatar

    This kata instructions are flawed.

    A friend of mine takes a sequence of numbers from 1 to n (where n > 0).
    Within that sequence, he chooses two numbers, a and b.
    He says that the product of a and b should be equal to the sum of all numbers in the sequence, excluding a and b.
    Given a number n, could you tell me the numbers he excluded from the sequence?
    

    So it gives us 26 as a test case, the sum of all numbers 1-26 is 351.

    [[1, 175], [3, 87], [7, 43], [10, 31], [15, 21], [21, 15], [31, 10], [43, 7], [87, 3], [175, 1]]

    Each number in this sequence can resolve the rules,

    351 - 175 - 1 == 175

    175 * 1 == 175

    351 - 87 - 3 == 261

    87 * 3 == 261

    351 - 43 - 7 == 301

    43 * 7 == 301

    351 - 31 - 10 == 310

    31 * 10 == 310

    351 - 21 - 15 == 315

    21 * 15 == 315

    All the above are solutions to the problem but his only solutions are 15, 21 which is incorrect. Just doing the math on paper proves that. So the rules need to be revised because all the needed information is not provided.