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.
Loved the use of and operator
data[ptr] = (data[ptr] + 1) & 0xff;
The regex doesn't work if paramatres are set to more than one character.
E.g.
stripUrlParams('www.codewars.com?a=12&a=34');
This should work:
/&?([^?=]+)=[^&]+/g
The more I look at it, the more I like it.
We've got a rebel here.
This comment is hidden because it contains spoiler information about the solution
Your solution fails for this test:
isMerge("catodc", "cod", "cat"); // should return false, but yours return true
What a horrible piece of ... kata.
Finally somebody with IIFE solution. I thought I was alone :D
How many more "names" variables will you create?
You don't need ToArray()
You should read again about Big-O Notation. It doesn't matter how high n will be, it will require the same constant number of operations(sqrt, log, sin... doesn't matter what math operations are used). For O(logN) algorithms the number of operations isn't constant and will grow propotional to logN.
Recursion would really be bad for big n, but since the return value is int you shouldn't expect values for n larger than 46.
It's not O(n), it's O(logN).
passing 0 as a parameter will throw "inputs must have a value", which is not correct here.
If the layout is changed, you will have to recalculate all keys. (Read the hint in the description).
Loading more items...