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.
This comment is hidden because it contains spoiler information about the solution
The underlying expression of your statement is incorrect, because this function will be implemented into other code and so this function will be executed an unknown number of times per second. Always keep that in mind :) .
Thanks, this is really sad. Maybe i will create my own platform like this here then, just with much less bugs and proper core-features.
The github feature-request is over 2 years old. If a platform isn't capable to implement such a core feature after even 2 years, this is not a good sign and so maybe this platform will be going down at some point :/
This has to be a joke. Are you a developer/maintainer from codewars or just some user?
I doubt that a modern (looking) website, that is about "coding", lacks the ability to set profile images and then doesn't even generate random images like github.
Is this feature really not existing here? If so: Why?
Very hard to read, to understand and to maintain. This code should never be used in production.
You should definitely refactor your code.
Very very hard to maintain and to read. You should refactor your code.
For me it correctly returns "10". I think you copied something wrong maybe?
I 100% agree, but since upvoting replies does not work for me on codewars, have my reply.
Just did a benchmark myself, looping over 10.000.000 array-entries:
From what i read, the
forEach
was drastically slower in previous node-versions. But since year or so at least, it is now on an equal level. But seems that, if you want performance, you should use the standard for-loop, because it's just way faster.But i also understand your opinion on the pure function part.
Same solution as mine, but to add the missing 1%:
directionValues
the possible keysn, s, w, e
.forEach
.There are several people out there who say that
forEach
is bad, but i didn't verify any of those.You should refactor your code.
You should refactor your code and also only loop through the array once.
Very interesting and creativ approach.
But i think the performance is the same as just looping through the array once, counting the appearances for each orientation and at the end check, if
n==s && e==w
. And i think the approach i mentioned is way easier to understand and also to maintain.Edit: I think the solution i mendioned is even a fraction better on performance, but it's really more about readability and maintainability.
You should think about refactoring your code.
How can i change my profile image (without beeing forced to link some social accounts)?
Loading more items...