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.
An outstanding resolution, it show's how important is to understand clearly the data and how to reduce it as patterns before doing nothing.
Provided that is a valid str, you will always get something like () [] {} in the last nesting, as simple as that.
and that's still NOT an issue, because, AGAIN, the whole point of the kata is to do it by yourself. With BigInt, this is 7 kyu, not 2...
can we add Node v10.x as a runtime because BigInt is worth it here.
Not sure what you have against bigint, like sure there is some cryptic way to do it, is that the point of your submission? To only allow one specific resolution to a problem? But you can't come out and say that and would rather waste peoples time rather than enable suitable tooling?
I mean if you want performance, why are you even using js in the first place? There is no good reason to not enable 10x, none at all. What a waste of time forcing people to use years old stacks.
This issue is NOT closed, there isn't any good rational for doing what you are doing here.
This comment is hidden because it contains spoiler information about the solution
BigInt
.can we add Node v10.x as a runtime because BigInt is worth it here.
This comment is hidden because it contains spoiler information about the solution
Works fine in chrome, not here. (javascript)
returns: Expected 23 got 8779
It is obvious something is wonky with the submit tests, I know this function works, and I know from previous experiments that 8779 is the answer to the NEXT test pass, but submit test is broken.
Am I missing something "obvious" myself? I am not doing anything global or modifying shared objects (and IIRC this runs single threaded). I think the submit answer key is wrong at the time of this writing personally.
will post my solution as a spoiler response if anyone wants to tell me what I'm doing wrong, or confirm.
It is nice but mine is faster ;)
You can usually find a faster solution than the terse ones, plus I understand them better.
Some of the regex ones are crazy fast though, but some are slow (and I only js in the browser, so this environment is another variable, for me anyway)
Yah good eye, I may have to retract that comment, not sure what happened but it isn't working in chrome now.
I might have been messing with polyfills, ah well it would be nice syntax, swiss army array objects.
Also it is a little silly, it is a triangle function so it will only ever have the 3 arguments, but I was hoping to experiment with lists in js more.
bits and signs are challenging in js, learned a lot.
Was interested with your commented solution. After some searching I understood, that I don't understand how could it work in Chrome.
-In JS 'arguments' is not an Array but Array-like object, it has only 'length' property. To convert easily there is a variant using spread operator '...'.
-When you use Math functions you can't call them without Math (i.e., Math.max(args)).
-Math object doesn't have sum() function at all, the best practice I found is using reduce (just as you used above).
I tried to adjust all that and here is a working modification (but imo it's not so elegant)
function isTriangle(a,b,c){
return Math.max(...arguments) < Array.prototype.reduce.call(arguments,(a,b)=> a+b)-Math.max(...arguments);
}
PS: never thought about max() function and I like your implementation.
The instructions should clearly state that atob or btoa are not allowed, otherwise they aren't instructions.
Thanks, enjoyed developing and optimizing this in chrome, had it print out the spiral x by y every step and was able to narrow down the end game fairly quickly.
It's bulky but it's fast (at least in chrome) and easy to follow :)
Loading more items...