The python translation's random tests can test with zeros, but don't always, allowing solutions that don't handle zero correctly to pass. Zero inputs should be tested explicitly in the basic test cases. Fix
I think the Rust huge_random_test input sizes are little too big: Two different O(n log n) implementations I tried both time out, but look very easily distinguishable from a O(n^2) implementation timing-wise:
The python translation's random tests can test with zeros, but don't always, allowing solutions that don't handle zero correctly to pass. Zero inputs should be tested explicitly in the basic test cases. Fix
Yes, my solution passes now. Thanks!
Well-composed. Nice names. Very readable. 👍
This is still a problem. Example solution that should not pass.
This is still a problem. Example 'solution' demostrating the need for random tests
I think the Rust
huge_random_test
input sizes are little too big: Two different O(n log n) implementations I tried both time out, but look very easily distinguishable from a O(n^2) implementation timing-wise:In C++, there is no reason for this to be a class member function. Have the user declare a bare function.