Ad
  • Default User Avatar

    I still do not understand:
    [1, 3, 5, 7, 9, 11, 13, 15], N = 4

    • sequential - True
    • odd - True
    • equal to cube N - True

    findSummands(3) = [7,9,11] // because 7 + 9 + 11 = 27, the cube of 3. Note that there are only n = 3 elements in the array.

    added:
    I think I understand now! Thank you!

  • Default User Avatar

    Misleading description! (python lang)
    From the description: "you need to find consecutive, odd numbers whose sum is equal to the cube of a given number."

    Using the example N = 4, as a result, all tests pass, except for the length test:

    • iterate from the beginning: sum([1, 3, 5, 7, 9, 11, 13, 15]) == 4 ** 3 Incorrect length for n = 4: 8 should equal 4
    • iterate from the end: sum([31, 33]) == 4 ** 3 Incorrect length for n = 4: 2 should equal 4

    There is still 1 option left for N = 4: [13, 15, 17, 19]. Judging by the tests, this is exactly what is needed, how should I guess about it?

  • Default User Avatar

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

  • Default User Avatar

    Just need to check equivalence instead of equality:

    • js: "==="
    • py: "is"

    because the type of the variable must also be taken into account.

  • Default User Avatar

    A good task, but your solution (Python lang) does not provide all possible options, for example print(eq_all([0, False])) will return True although it should be False. It would be nice to include something like this in tests.

  • Default User Avatar

    Wrong description!

    • According to the condition: it is necessary to find the indices of the letters (the index starts from 0)
    • In fact: the order of letters in a word.
  • Default User Avatar

    I have not even hit the Train button because I don't understand a word of this description.

    This is not the original comment! The original was removed as it I reconsidered all of the above and changed my judgment, I was too hasty. I worked on the description of the task of this kata. And I also wrote about this in the first answer.

    Thanks for your feedback. =)

  • 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

    This is not the original comment! The original one was removed because it did not solve the problem!

    On business:

    • Remark on this kata accepted.
    • Changed the description of the task and example.

    Thanks for your feedback! =)

  • Default User Avatar

    “This would not fly for test”, but the tests have already worked, maybe with a single test in the group, division into individual ones is not necessary, I’m not sure. However, from a “clean code” point of view, I agree that separate tests should be allocated in the group. Already fixed it, thanks for the note.

  • Default User Avatar

    Thanks for your feedback. In random tests, lists were actually passed as arguments instead of strings. This was not done intentionally, my oversight. Already fixed it. =)