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.
contains is the function for "in" operator. When we import it as "include", that does the trick.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
best and beast practice.
This comment is hidden because it contains spoiler information about the solution
In my opinion, in addition to "Best practices" and "Clever" there should be 3rd attribute called Efficient in Codewars.
Similar to this example, the most of "Best practice" and "Clever" solutions have less efficiency than other solutions.
one of the most clever solutions on CW
not an efficient solution.
How is this solution O(n)?
For each element in arr, it checks if the i in s. "if i in s" is O(n) as well.
more efficient than best practice.
I don't think so. It teaches you how not to invent the wheel by utilizing existing functions.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution