Ad
  • Custom User Avatar

    This solution uses Ruby's combination method to generate all possible combinations of 2 elements from the input array. It then adds the sum of each combination to a hash, with the sum as the key and a value of true. If the sum is even, it will be added to the hash. Since a hash only allows unique keys, the size of the hash at the end will represent the number of distinct even sums.

  • Default User Avatar

    JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai).
    Refer to this and this

  • Custom User Avatar

    I think the description needs to be rewritten so its clear exactly what you want. Maybe using bullet points for each stage?

  • Custom User Avatar

    Needs Random Tests.