The triplets in the return value should be ordered a < b < c, right? I kind of get mixed messages:
With n = 849
Expected (134, 1998, [629, 540, 829]) but got (134, 1998, [540, 629, 829]) at src/lib.rs:46:9
With n = 541
Expected (87, 1302, [341, 420, 541]) but got (87, 1302, [420, 341, 541]) at src/lib.rs:46:9
Is this an issue with the rust translation/the random tests for rust or am I missing something?
The return type is not an Option, so what else can you do? The only other thing is to use a checked operation explicitly so that it remains in the release configuration, but it isn't the default choice.
This code compiles for the pre-set test but does not consider the worst case. It is not a good practice not to consider the worst case. For example: If you enter an i32::Max or an i32::Min as a parameter, this code will panic. Reporting this code as "Best Practice" is not a good sign of knowing how to look deeply into the problem that has been posed.
my lame ahh spending and extra 2 seconds adding a closure
I liked the "str::to_string" part.
Clever!
bouncing_ball(1., 0.5, 0.25)
will return 5 instead of 3 hereCool and tricky
The array INV contains the multiplicative inverses of the indices modulo 26 or 0 if the index is not invertible modulo 26.
Could you elaborate, what
1, 9, 21, ...
are and how you obtained these values?This comment is hidden because it contains spoiler information about the solution
Could you elaborate, how this works?
This comment is hidden because it contains spoiler information about the solution
Could you elaborate how this works?
The triplets in the return value should be ordered
a < b < c
, right? I kind of get mixed messages:Is this an issue with the rust translation/the random tests for rust or am I missing something?
It should panic, according to the description that's an invalid input.
If you enter 11 the code will panic. I don't think this is a "best practice."
The return type is not an
Option
, so what else can you do? The only other thing is to use a checked operation explicitly so that it remains in the release configuration, but it isn't the default choice.This code compiles for the pre-set test but does not consider the worst case. It is not a good practice not to consider the worst case. For example: If you enter an i32::Max or an i32::Min as a parameter, this code will panic. Reporting this code as "Best Practice" is not a good sign of knowing how to look deeply into the problem that has been posed.
Loading more items...