Ad
  • Default User Avatar

    Rust: The tests seem to have issues.

    I got this compilation error:

    error[E0308]: mismatched types
       --> src/lib.rs:129:9
        |
    129 |         assert_eq!(partitions(n), size);
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32`
        |
        = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
    
    For more information about this error, try `rustc --explain E0308`.
    error: could not compile `challenge` due to previous error
    
    
    NOTE: Line numbers in error messages can be incorrect due to concatenation.
    

    I suspect the size variable in the test is u32 instead of usize.

  • Default User Avatar

    The first check should be first.len() != second.len(). Otherwise, the answer may be wrong.
    E.g.,

    first = "a"
    second = "aa"

    The answer should be None instead of 0.

  • Default User Avatar

    For elixir: The test for integer = 2 is wrong.

    Correct result: "2 is prime"
    Result expected by Codewars: [2, 1]