Ad
  • Custom User Avatar

    This kata "assumes" that you should have OOP basic knowledge.

    "Additionally, this Kata assumes that you have basic knowledge of Object-Oriented Programming ( or a similar concept ) in the programming language you are undertaking. If you have not come across Object-Oriented Programming in your selected language, you may want to try out an online course or read up on some code examples of OOP in your selected language up to ( but not necessarily including ) Classical Inheritance."

    Although, this is not necessary because you don't need that. The language can be not object-oriented (like C) neither the algorithm requires and/or uses inheritance.

    I suggest to remove this paragraph for better clarity.

  • Custom User Avatar

    In C++ programming language, code shows std::vector<std::vector<int>> as a result when test expects std::array<std::vector<int>, 2>

    In file included from main.cpp:7:
    ./tests.cpp:4:29: error: no matching function for call to 'validateTwoSetsOfEqualSum'
    auto verification = validateTwoSetsOfEqualSum(i, createTwoSetsOfEqualSum(i));
    ^~~~~~~~~~~~~~~~~~~~~~~~~
    ./preloaded.h:8:13: note: candidate function not viable: no known conversion from 'std::vector<std::vector >' to 'const std::array<std::vector, 2>' for 2nd argument
    std::string validateTwoSetsOfEqualSum(int n, const std::array<std::vector, 2>& answer) {
    ^
    1 error generated.

    As a suggestion, change the code to return the expected value as a std::array<std::vector<int>, 2> in conformance with your test function or change your test function to expect the std::vector<std::vector<int>> type.

  • Custom User Avatar

    Upvote just for the cat.

  • Custom User Avatar

    My intention was not to criticize you but, that is a really bad answer. An answer that I didn't ask for.

    Even using other programming language, and the resulting code is by other programmers, the fact that people upvote to this is not good. Anyway, nothing can be done.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    If you really want to learn, try to be positive as when you receive the feedback about the people comments. Clearly this is not a good solution.

  • Custom User Avatar

    Not as simple nor readable as could be.

  • Custom User Avatar

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

  • Custom User Avatar

    Not a critique to the author of the solution but, I don't know why people marked this kind of solutions as best practices or clever if it uses a lot of functions and a data structure that make the algorithm waste computational resources.