Ad
  • Default User Avatar

    I can not diecide between BP & C

  • Custom User Avatar

    This is a task that, like all tasks here, requires you to provide a valid solution, whatever it is. If an author doesn't want some library to be used, it's up to him to make it impossible.

  • Custom User Avatar

    I beleave This is not a task for using standard library from STL. I thnk they wanted us to create our own logic.

  • Custom User Avatar

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

  • Custom User Avatar

    This kata is asking you to find the maximum length difference between any two strings within two lists. I don't think this is a spoiler because I just reworded the "pseudo code".

  • Custom User Avatar

    Sorry about that I'm still new to codewars and didn't know what to mark it as.

    Yes I did rename the class when I was working on it in eclipse (in hindsight I won't be doing that anymore), but I make sure I don't change anything in the codewars editor and only add code. I retried it with renaming the class and same issue.

    Turns out I'm just having server connection issues, tried a few kata I've finished already and I'm having the same connection issue.

    Sorry about the confusion, I know better now thanks!

  • Default User Avatar

    Please do NOT create an issue, if you are not sure there is really a problem with the kata.

    You renamed the class... So the tests cannot find your solution.

    Rename it back to "Kata" and it should work.

  • Custom User Avatar

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

  • Default User Avatar

    No problem!
    Great, that you solved it!

    Have a good time on CodeWars!

  • Custom User Avatar

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

  • Default User Avatar

    Ahhhm, NO!
    I checked the first 20 C++-Solutions. No one changed the prototype!

    Search for another way. It is possible! :-)

  • Custom User Avatar

    It's not the prototype -- you're right. The 306 people most likely changed the values in the test case. I can pass this kata by changing that last test case from { 2, 4, 3, -4.5 } to { 2, 4, 3, -4 }.

  • Default User Avatar

    No issue.
    306 people solved this kata in C++ without any problem and without changing the prototype. ;-)

    You will also solve it. :-)

  • Custom User Avatar

    I think there's a bug using C++:

    To get the correct output for the 3rd test cast, the prototype for the averages function needs to be std::vector<double> averages(std::vector<double> numbers) not std::vector<double> averages(std::vector<int> numbers).

    If you make the fix, you get this compilation error:
    -isystem /runner/frameworks/cpp error: no matching function for call to 'averages'
    std::vector actual = averages(testInput);
    ^~~~~~~~
    note: candidate function not viable: no known conversion from 'vector' to 'vector' for 1st argument
    std::vector averages(std::vector numbers)
    ^
    1 error generated.

    Edit: Also, the question asks to compute the averages for a list of integers and the third test case has a float/double in the list (from the perspective of c++/c).