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.
approved.
Is there a reason
usize
is not used for the return type? It seems more natural if we're going to do conversions anyways, since a negative value is meaningless. Plus now there are situations where we can't give the correct answer.[i16::MIN, i16::MAX]
would product an answer of2^16 - 2
, which is way to big to fit in ani16
. I guess if we're going for minmalismu16
would be the appropriate type, but would require more conversion unless the input was also&[u16]
.best practice 🙏
i'm deceased
Sorry for getting back to this so late (notifications don't work and I forgot this existed)
Is there a reason random tests all have the same length? If those were to be random, then this is approvable.
Approved by someone
I understand that
xs.len()
is said to be>=3
and Rust has some underflow protection.Yet still
xs.len() - 1
is a buggy programing practice I don't that makes me nervous.If you could fix assertion messages, this would be approvable.
I'm also seeing changes to the description in the diff, though I'm seeing the same or varying changes throughout this chain of forks, so I'm not sure which of those you actually applied or not. Maybe give those another once over to ensure only necessary changes are made.
The translation it's forked from didn't pass its tests
Also, this would have been a good opportunity to improve the (missing) assertion messages.
EDIT: Disregard my comment about the current solution being correct;
cargo test
uses debug mode, in which case the overflow becomes a runtime error.EDIT 2: Disregard my third point. I hadn't realised this is a new translation, I thought it was an update to an existing translation. There is no current solution...
I don't quite see the point of your fork. From what I can tell, all you did is update the reference solution with one that you would consider "more correct". However
If you can give me a good reason for this fork to exist, I will consider it, otherwise I will simply reject this.
Approved by someone
i forgot to change the panic!() to something else.. my retardness is too powerful
it panics anyway if the index is out of bound, so why repeat the
Loading more items...