Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
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".
This comment is hidden because it contains spoiler information about the solution
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 }
.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)
notstd::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).