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 comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I feel stupid, I don't understand the assignment. Could someone who has done this explain what it's asking us to do? I scrolled through many comments and found instructions about edge cases and complaints about vagueness but couldn't find an improved description for the whole assignment. Thank you!
The description of this Kata remains unclear.
The description asks for a function with three stipulations:
1: the function "returns the sum of a sequence".
2: the sequence "is defined by 3 non-negative values".
3: the function "should returns 0" ... "If begin value is greater than the end".
According to this, in the case of rule 3, the sequence is still valid, and summing it 'should return 0'.
The description could be clearer by asking for a function that "returns the sum of a sequence if begin value is less than end, otherwise returning 0."
Not sure if this contributed to any confusion among the commenters, but I spent time trying to modify my function so that it would still return the sum of the sequence for all tests. Certainly beyond the difficulty of a 7kyu, but should anyone else interpret it literally, hopefully this will save you time.
D translation
[JavaScript] It would be great if the sample tests could throw in one or two negative numbers. I definitely tripped up in the random tests by assuming that all integers would be non-negative (-:
This comment is hidden because it contains spoiler information about the solution
Why i get tese errors?
./src/main/java/Kata.java:3: error: cannot find symbol
List index = new ArrayList<>();
^
symbol: class List
location: class Kata
./src/main/java/Kata.java:3: error: cannot find symbol
List index = new ArrayList<>();
^
symbol: class ArrayList
location: class Kata
./src/main/java/Kata.java:10: error: cannot find symbol
List nums = new ArrayList<>();
^
symbol: class List
location: class Kata
./src/main/java/Kata.java:10: error: cannot find symbol
List nums = new ArrayList<>();
^
symbol: class ArrayList
location: class Kata
./src/main/java/Kata.java:15: error: cannot find symbol
Collections.sort(nums);
^
symbol: variable Collections
location: class Kata
5 errors
No random tests in Haskell
@fyvfyv
Could you repare random tests for this kata? We have there ugly for:
for(int i = 0; i < array.size(); i++)
Which leads us to warning:
main.cpp:127:30: warning: comparison of integers of different signs: 'int' and 'std::vector::size_type' (aka 'unsigned long') [-Wsign-compare]
My solution uses an array method, so that's obviously not true. Moreover, this restriction is more annoying than anything.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution