Ad
  • Custom User Avatar

    Your solution fails on this test:
    in_array(["foo bar", "foo", "bar"], ["foo", "bar"])
    Sorry.

  • Custom User Avatar

    '{}'.format has been deprecated for f"{n}"

  • Custom User Avatar

    Please start using spoiler flag when discussing solutions. Otherwise anyone who hasn't solved the kata can see your post in the homepage.

  • Custom User Avatar

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

  • Custom 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.

  • Custom User Avatar

    At least share an analysis of the complexity of the algorithm or a real benchmarking comparsion :-)

  • Custom User Avatar

    Running twice through the arrays does not make this o(n^2), it is not very effective, but still linear. There are different aspects under which you can consider a solution as "best". Performance is only one. Sometimes input sizes are small and performance doesn't matter, then readability and simplicity matters more. Unfortunately Codewars didn't allow to rate in different categories earlier, and now only allows to rate in "best practices" and "clever" solutions. I'd like to have the former split into "best performance" and "most simple/readble". After all, if performance would be my only criterium for every little function, I would use C instead of Python.

  • Custom User Avatar

    It makes no sense to talk about asymptotic complexity for a limited input range. And little o is a different thing.