Ad
  • Custom User Avatar

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

  • Default 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

    I coped response from console and this is clearly reproducible. My function return false but assertion in tests expect true.

  • Default User Avatar

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

  • Custom User Avatar

    Ok. I know that you tried some. I already spend two days fighting with this cata. Can you, please, answer on My question.

    36100 = 190 * 190 and there are NO 190 in the a array. Why attempt tests return true here?

  • Default User Avatar

    I tried some solutions and I saw no problems.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Default 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

  • Default 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

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

  • Default 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

  • Default User Avatar

    I'm not sure how JavaScript is currently defined in Codewars, but when this was published, it was probably ES5 which had no spread operator. Wwhat's the "best" solution can change over time, and even depends on the platform. What's best for Internet Explorer, may not be the best for Firefox. What's best for Firefox 3 years ago may not be the best today. And what was considered "difficult" to read yesterday may be considered simple today, when certain idioms have become more widely supported and used.

  • Loading more items...