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.
very complicate your solution
This comment is hidden because it contains spoiler information about the solution
Clever? Absolutely. Best Practices? not really. Better practices than my answer for sure, but I wish every JS answer on code wars wasnt a competition to make the shortest code. Not the author's job to teach others, but ppl shouldnt vote things like that as best practices.
Semi-related -- the highest voted answer to why they used 'd|0' doesn't answer the question. They did that instead of 'parseInt(d)''. It works for small numbers. Past a certian value, it can start giving the wrong number or sign.
Why is that?
sets aren't a good idea either, here... ;p
This is awesome and I need to start using HashSet. My solution was 80 lines of garbage compared to this.
And the random list (at least in javascript, ruby and java) is also ordered. Not a kata issue.
-3, -2, -1, 0, 1
that's -3-1Ignore the instructions and look at the test cases.
The test "It should work for random inputs too expected" directly contradicts the instruction "so that it takes a list of integers in increasing order".
Also the only example is wrong. rangeExtraction({...-3, -2, -1,...}) should be "...-3--1...", but the instruction tells you that it expects "...-3-1..." (the negative sign was left out).
There should be a test (js) where the final string is not over the limit, but the input string is over 140 char limit. Most of these best practices answers test to see if the input string is longer than 140, but the description says that the output string cant be over 140.
if you are going to do it this way, you might as well just return the whole thing. if you say if(*boolean) return true; else return false; its the same as saying return *boolean
Shouldnt a b -(RPN) evaluate to a - b? Because the test cases seem to want it to be b - a