Ad
  • Custom User Avatar

    I prefer the actual description

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks. Will fix this and other Katas in which I may have used these undeclared types.

  • Custom User Avatar

    Yes, kind of.

  • Custom User Avatar

    So it's not a problem now but could be a problem in future?

  • Custom User Avatar

    The tests in C++ use potentially undeclared identifiers like rand and shuffle. Just to remind, when C++17 was added to CW, there were maybe 5 katas that were incompatible because of name clashes and things like that and a huge list of those incompatible because they used non-standard features and weren't correct in the first place.

  • Custom User Avatar

    Let us know.

  • Custom User Avatar

    Not really an issue. More of a suggestion. It looks like you understood it well enough.

  • Custom User Avatar

    I withdrew the "elements of integers" part as "whose" is likely referring to the array, but the other points stand.

  • Custom User Avatar

    Where do you read "elements of integers"?

    "You will be given an array of integers whose elements..."

    The elements are from the array.

  • Custom User Avatar

    The description is extremely unclear.
    "You will be given an array of integers whose elements have both a negative and a positive value, except for one integer that is either only negative or only positive."

    In this sentence are such gems as "elements" which "have both a negative and a positive value", "except for one integer that is either only negative or only positive" (weird, I thought all nonzero integers are like that!)

    I propose:
    "You will be given an array of integers such that, for any integer x in the array, there exists exactly one integer equal to -x in the array. There is one exception, an integer that does not have such a complement. You need to find it."

  • Custom User Avatar

    You need to calculate the infinite sum (first term is n, each following term is the previous term integer-divided by 2), not just the sum of the first five terms.