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.
Honestly I din't know about the min function either, but was also able to do it with a loop. I personally think that will help you in the long run. You can learn all the shortcuts later, if you know how to work through the problem without a built in function, that's great imo.
Thanks for the help.
modified the tests, remove all Option and ... submited !
Thanks.
Neither sample tests nor the submission tests expect an Option. This was discussed in the translation discourse and it was decided that the inclusion of a few negative numbers just for the sake of including a few negative numbers was silly.
It is possible that you opened the kata in the small window when the translation was published, but the sample tests still had the Option as an expected result (see issue raised by Unnamed below). If so, you can either ignore the sample tests or reload/reset the kata to see the updated sample tests. I would suggest simply ignoring them. The expected return value is a
String
, so just use that.Yes as requested by the tests :
Ok(...)
Except for negative input, returns None.
"Test" is ok.
"Attempt" is not.
Is your solution returning an Option?
tests ok, even fact(800)...
But when attempt :
error[E0277]: can't compare
String
withOption<String>
--> src/lib.rs:131:26
|
131 | assert!(expected == actual, "For number {num}\nExpected:\n{expected:?}\nActual:\n{actual:?}");
| ^^ no implementation for
String == Option<String>
|
Rust tests are not ok.
seconds % 3600 % 60 could be only
seconds % 60