I don't think it's a good practice in Rust to import inside a function.
I think it's a good idea to use a tuple rather than an overwhelming struct or hashmap or whatever. However I would add an explicit note in solution set up so the user knows exactly what is expected in the tuple.
Done - worth noting I based my translation on Java tests, which don't separate tests for 5..10 and 11..50, but I hope I understood what you meant here.
Actual and expected are reversed in test_5_through_50.
Also, to match with the Python tests, please use assert_eq! (what you have now) for 5..10, but for 11..50, use assert! and == so the user can't see the expected value => harder to hardcode.
Yes, anyone with 4k+ honor can approve other translations.
Note: if the author was active less than a month ago, the translation has to be at least 1 week old first.
I'll have a look at it + the Julia translation.
I thought I'd add the translation, but found you had already submitted it! :-)
It unfortunately seems the kata author @Bugari hasn't visited the site for quite some time. Is there perhaps an alternative mechanism to approve translations?
I don't think it's a good practice in Rust to
import
inside a function.I think it's a good idea to use a tuple rather than an overwhelming struct or hashmap or whatever. However I would add an explicit note in solution set up so the user knows exactly what is expected in the tuple.
fn pick_peaks(nums: &[i32]) -> (Vec<usize>, Vec<i32>)
Didn't check any logic or test cases or description so careful review is necessary before approvings
The definition of
PosPeaks
probably should be in the Preloaded section and in the kata description.arr
isn't the best name for a non-array.No mutable! Congratulations!
bravo, beautiful algorithm !
approved
Done.
Merge conflict--fork and update the description.
Yes, that's what I meant.
Done - worth noting I based my translation on Java tests, which don't separate tests for 5..10 and 11..50, but I hope I understood what you meant here.
That's great news. Thanks a lot for the headsup @stɛffan153! Have a great day.
Actual and expected are reversed in
test_5_through_50
.Also, to match with the Python tests, please use
assert_eq!
(what you have now) for5..10
, but for11..50
, useassert!
and==
so the user can't see the expected value => harder to hardcode.Yes, anyone with 4k+ honor can approve other translations.
Note: if the author was active less than a month ago, the translation has to be at least 1 week old first.
I'll have a look at it + the Julia translation.
I thought I'd add the translation, but found you had already submitted it! :-)
It unfortunately seems the kata author @Bugari hasn't visited the site for quite some time. Is there perhaps an alternative mechanism to approve translations?