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.
The description should disclose number of tests: 30 tests up to 1000 soldiers each. This would allow to deduct that any
HashMap
solution will likely not pass.Rust code does not take into account that Balzer starts from the last element.
Modifying initial tests
squad[0] = TRIGGER_STATE;
tosquad[size-1] = TRIGGER_STATE;
does not help, because the final tests have it hard-coded as well.The same problem may exist in other translations.
The final tests contain 50 tests with ~1k elements and 10 tests with ~20m elements. Make sure you can pass all within the timeframe of your language.
I think the longest mountain pass in your example is
[1,2,3,4,6,6]
so the answer should be(6,2)
, because5=(2-1)+(3-2)+(4-3)+(6-4)+(6-6)
. No?Good catch. Fixed.
Incorrect assert message in Rust:
assert!(actual == expected, "Expected score with dice {dice:?} to be {actual}, but was {expected}\n");
Actual should be swapped with expected.
Rust tests expect
power_sum_dig_term
whereas the sample function has uppercase characters.Please use spoiler flag next time. Your post was visible in the homepage discourse.
This comment is hidden because it contains spoiler information about the solution
I was able to pass the Attempt test suite in Rust without any issues. Please post your current solution, mark it as a spoiler and specify the input(s) causing your solution to fail so we may reproduce your issue and determine whether it is indeed a problem with the tests.
Closing the issue since there's insufficient evidence it's related to the Kata itself.
Would it be possible for someone to fix Rust?
To be clear, there is an unwrap here: 0 inside
fold
is the default value. Same you could write as.max().unwrap_or(0)
, which is also correct error handling..unwrap()
is what you should never use...This comment is hidden because it contains spoiler information about the solution
When attempting to pass Rust the error message says that my code returned an empty array. When I insert the same input into initial tests the code runs fine and returns data. There is something wrong with final tests.
It's a really interesting kata, but according to people who did this task this kata is too difficult for kata 6. I think this kata sould be kata 5 and it would be cool if this task had tags for searching, such as "trees" and "recursion"
Loading more items...