Ad
  • Custom User Avatar

    Lots of guys passed the Rust kata so I am sure there is a problem in your code.
    Avoid to mutate the input; don't sort too soon; rather square elements of a instead of taking the square root of elements of b (you are introducing float approximations).
    Good luck and notice than downvoting others' answers doesnt help:-)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I tried some solutions and I saw no problems.

  • Custom User Avatar

    Really sorry, English is not my "mother-tongue" but it is not useful to be unpleasant...
    I don't have any "ego". If you knew how old I am you could understand that.
    I care that others could learn otherwise I wouldn't have written as many translations.

    Moreover you downvote my posts to no avail since I could do the same with yours.

    PS: by the way the description was rewritten by another guy... but it seems that it is the same gibberish:-) I am waiting your proposals and your authored kata. Criticizing is easy, doing is less.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    In the explanation it is said:

    a = [121, 144, 19, 161, 19, 144, 19, 11]  
    b = [121, 14641, 20736, 361, 25921, 361, 20736, 361]
    comp(a, b) returns true
    

    I think you wrongly read the description or maybe I didn't understand your post. You can note that 350 guys passed the Rust kata.

  • Custom User Avatar

    Exactly. This is very readable and readability is more important than performance. Also, this may be even more performant, particularly for small arrays, because you can use existing, already optimized functions instead of writing custom code that neeeds to be interpreted.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution