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
I don't know
Please specify the language when raising issues. I'm assuming you're referring to the C translation.
No, the size of the allocated buffer is irrelevant as long as it's big enough. What's important is to set the value of
nb_vowels
appropriately (refer to the solution setup).Not a kata issue. Next time, please raise a
Question
when you're unsure.I reduced the input size to max 300 elements.
They were removed because the kata was decided to not be a performance kata. It would be quite inconsistent if some languages allowed slow solutions while others enforced performance. I really don't know if Rust can trivially handle 10_000 element arrays even with very slow solutions, but the intent is that performance shouldn't be on solvers minds at all (or at least, it shouldnt need to be).
In my original Python translation, hard tests could go up to 10_000 elements, but Kacarott removed those tests in his fork. Rust is much faster than Python, I tried to make roughly equivalent tests in both languages, though I have no real idea about what a naive solution would give.
0..100_000 is the length of the array, not the values inside it. The values are random signed 32 bits integers (
rng.gen::<i32>()
).I've forked it with the changes you wanted
Essentially, yes. You have to sort and you have to allocate at some point.
Because
lst
is a slice ofu8
s and slices are non-owning by definition, callinglst.iter()
results in an iterator of references tou8
s (Iterator<Item = &u8>
).The return type of the
delete_nth
function isVec<u8>
, which can be built through.collect()
only from an iterator over owned values (Iterator<Item = u8>
).The iterator methods which allow such a conversion (from
Iterator<Item = &u8>
toIterator<Item = u8>
) are.cloned()
and.copied()
(either one works in this case).This comment is hidden because it contains spoiler information about the solution
Strings are immutable in Python, so, what you do inside your function with its arguments is up to you.
This comment is hidden because it contains spoiler information about the solution
In Python N is as big as 1000000000. Note this: