Ad
  • Custom User Avatar

    Issue is closed, read above comment

  • Custom User Avatar

    WOOOOSH

    Let me rephrase it, then: Besides, C++ is just C, but with classes, isn't it? BIG WINK EMOJI ;););)

  • Custom User Avatar

    I don't agree with you.

    Modern C++ is not just C with classes.
    Completely different constructions are used to solve problems.

  • Custom User Avatar

    Duplicate of a suggestion raised already 2 years ago. Author explicitly stated that they want the function signature this way.

    Besides, C++ is just C, but with classes, isn't it?

  • Custom User Avatar

    Why is a function signature in с-style given for C++ kata?

    void check_is_contained(int **mat1, const int mat2[3][3],const int nrows, const int ncols, int &row, int &col)
    

    I propose changing to c++ style

    std::pair<int, int> check_is_contained(std::vector<std::vector<int>> mat1, std::vector<std::vector<int>> mat2)
    {
      // solution
      return { row, col }; // or tuple
    }
    
  • Custom User Avatar
  • Custom User Avatar

    Ainur try to run your solution on this test:

    List(5, 5, 4, 3, 3)
    

    Correct answer is 0 (List(5, 5), List(3, 3, 4))

    Your algo says: 2

  • Custom User Avatar

    I have some problems with test case - "minDiff on random generated piles should be ok"
    Input: List(979860, 858272, 854452, 698901, 687688, 684485, 493090, 306875, 292611, 290339, 266237, 82990)

    Output:

    Test Failed
    30064 was not equal to 2520
    

    I think the problem is in the test because my result is correct

    My result: first stone = 3232868, second stone = 3262932, and min diff number = 30064

  • Custom User Avatar

    Since the ordering seems to be correct, I assume, that you have one white space character causing this problem.
    Assert usually does a string compare. If the actual string has one space too much, becuase you were simply adding 'number + " "' each time, the result seems like yours, but contains the whitespace, which is not shown.

  • Custom User Avatar

    You can see at the top of the page how many people passed the C+ kata.

  • Custom User Avatar

    I don't think so. The length of the lines is the same.

     ****************** Random Tests **** orderWeight
    136
    136
    

    I think the problem is in the test. Most likely my result is compared with an incorrect value. In the fixed test everything is correct.

  • Custom User Avatar

    In your expected answer, there is "equal to " that is not present in your actual answer.

    Maybe the expected answer in this particular test case is different than the others test case?

  • Custom User Avatar

    I have the same problem

  • Custom User Avatar

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