This code doesn't follow typical styling, which would have the line broken into a couple new lines and helps dramatically with readability. I think some believe one-liners look cooler.
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.
I've finally read that I had to round results, but test cases for C++ showing me:
ExampleTests
Expected: [ 4.2, -35.8, -2.8, 23.2, 11.2 ]
Actual: [ 4.2, -35.8, -2.8, 23.2, 11.2 ]
were really misleading.
They were literaly telling me that x is not the answer because the answer is x.
_ is NOT unreachable. It can be reached due to misuse of the provided function.
This match arm should panic with clear message targeting API user who misused the function.
This comment is hidden because it contains spoiler information about the solution
oof
i'm deceased
You should think for yourself, not in my place.
This code doesn't follow typical styling, which would have the line broken into a couple new lines and helps dramatically with readability. I think some believe one-liners look cooler.
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.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
How did you solve problem?
This comment is hidden because it contains spoiler information about the solution
Really clean.
I've finally read that I had to round results, but test cases for C++ showing me:
One could tinker with
TC_COUNT
andRANGE
constants in “Test Cases” section.Interesting configurations include:
TC_COUNT
= 0,RANGE
= 0..=1000 which would enforce 0 randomness and covering literally all cases that abide by specification._
is NOT unreachable. It can be reached due to misuse of the provided function.This match arm should panic with clear message targeting API user who misused the function.
This comment is hidden because it contains spoiler information about the solution
Loading more items...