Ad
  • Default User Avatar

    I guess the short answer is that your solution doesn't work - some random test cases are generated and you don't pass all of them, but because they're generated randomly, you don't necessarily always fail on the same exact test case.

  • Default User Avatar

    I like my setup better than yours but I like your math a lot more than I like my own

  • 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

    The C++ compilation of the test case gives 2 warnings that can be very easily solved if somebody has edit access to the test (both of the variety where int is compared to size_type)

  • 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

  • Default User Avatar

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

  • Default User Avatar

    For the C++ version, I suggest the function signature be changed to either comp(std::vector<int>, std::vector<int>); or comp(std::vector<int> const& , std::vector<int>const &) - it feels very weird to work with two non-const references that I'm not supposed to modify. For testing purposes, I tried it out with the non-reference version and that passed tests anyway so you wouldn't even have to modify the test data.

  • Default User Avatar

    EDIT: I'm not allowed to delete this reply but it turned out to be in error. Let this edit remain here as a testament to my failure.