Ad
  • Default User Avatar

    why do you open a new issue if there is one already ?

  • Custom User Avatar

    As pointed out by eurydice5717,

    int main() {
    // comment
    }
    

    Should become:

    int main() {
    
    }
    

    NOT:

    int main() {
    }
    
  • Custom User Avatar

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

  • Custom User Avatar

    I think that the c++ tests have the wrong values in them. For example, the second test case looks like this:

    s = "456899 50 11992 176 272293 163 389128 96 290193 85 52";
    e1 = std::make_tuple(13, 9, 85);
    e2 = std::make_tuple(14, 3, 176);
    e = {e1, e2};
    dotest(s, e);

    The smallest weight is given by the "50" value at index 1 in the string. It should have weight 5, right? There are three or four of the tests that have this issue.

    Also, the syntax of the starting function is incorrect. The namespace qualifier is not required if you're defining the function inside the namespace. It starts as this:

    std::vector<std::tuple<int, unsigned int, long long>> Closest::closest(const std::string &strng)
    {
    // your code
    }

    It should be:

    std::vector<std::tuple<int, unsigned int, long long>> closest(const std::string &strng)
    {
    // your code
    }

    The current implementation doesn't build because of this.