Ad
  • Custom User Avatar
  • Custom User Avatar

    Read carefully the instructions, it's correct

  • Custom User Avatar

    I have the same problem

  • Custom User Avatar

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

  • Custom User Avatar

    Yes, it is n^3 in fact.

  • Custom User Avatar

    maxSequence([-1,-2,-3])

    Out: 0

    I think it is incorrect

  • Custom User Avatar

    I find this:

    • The code can pass fixed_tests, but failed at the random_tests;
    • There is a whitespace at the front just in random_tests;
    • If I erase the first character, random_tests passed but fixed_tests failed.

    So I think there are some differences between random_tests and fixed_tests.

  • Default User Avatar

    471 people passed the C++ kata so I can only think of a whitespace problem (CW most often concatenates whitespaces).

  • Custom User Avatar

    C++

    Expected: equal to 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
    Actual: 302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988


    And I run it on CodeBlock, add

        std::string t = "302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988";
        std::cout << ws.orderWeight(t) << std::endl;
        std::cout << t << std::endl;
        if(t==ws.orderWeight(t)) std::cout << "same";
        return 0;
    

    The output is:

    302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
    302163 63322 36067 437071 73921 226472 37085 484016 13974 449034 222199 247517 378027 52938 95454 129592 93962 7995 329676 145988
    same

    So what can I do?