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.
@wylaris .. Well , That's Okay , Because of
my_solution(mut lst: Vec<i32>, n_largest_elements: i32) -> i32
, Should Be Updated With the Same Newer Code to match the testsSays published with failed tests but it works every time I run it so idk...
Fixing it now
Yes, you're right I must have had the two confused when I made this. I just fixed it, thanks for letting us know!
@wylaris..
Thank you! Good kata! ;)
Check that.
JavaScript, all tests passed, except one, where: Expected: 'Willaim', instead got: 'William'
That test is ok, so the problem should be in your code. Check below, mmacak28's post, where I explained it (somehow) without spoiling it too much.
Chloe is the second but in ascending order.
Maybe you're sorting the list in the wrong order?
For this test case it is expecting the answer to be Matthew but I'm getting Chloe. What is confusing me about this is Matthew is coming out to be the largest in my code.
testing("Elijah,Chloe,Elizabeth,Matthew,Natalie,Jayden", vec![1, 3, 5, 5, 3, 6], 2, "Matthew");
Thank you for your help Chrono79
Could you provide an example? I don't do Rust, but I can check the expected result with other language and tell you if it's a problem with the rust translation or it is a problem with your code.
I don't think the tests in Rust are accurate. I'm fairly certain I have a working solution but I am still failing the tests and the asserts are not making sense.
@wylaris .. Well , Peyton at the random testing Section this Piece Of Code
for _ in 0..50 { let mut rng = rand::thread_rng(); // Increasing the size of either the number of values in numbers or the range of values // will either result in (sometimes randomly) overloading the main thread and causing a // painic! let numbers: Vec<i32> = (0..10) .map(|_| { rng.gen_range(-10, 10) })
Vector size range: [3, 202)
.,,Element value range: [-100, 100)
I assume you mean for the random testing increasing the integer range? I tried to increase the range but anything larger causes intermittent thread overloading for some odd reason. I'm not quite sure why, I can try to increase the size of the Vec but idk if that'll fix it.
@wylaris
Loading more items...