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.
definitly not best practice
I know right. That's just way too many lines😂!!!
Not anymore, no. I was pointing out that the kata's tests were horrible. It's been fixed.
I am completly agree with with issue. It needs to be fixed, it messes up the task solving and make solutions hacky
It doesn't work
Would like to use map-filter-reduce combo,
This solution currently doesn't pass tests - Execution Timed Out (12000 ms)
I suppose punctuation cases were added later...
It looks like trolling
Very good o(n) solution!
Spend lot of time figuring out, why tests sometime pass, sometimes throw error.
@koushik72, magic constants are numbers which appear in a program.
Often repeatedly.
For example, if you had a conversion program and used the conversion factor as a number everywhere, that would be a magic constant.
Having magic constants in a program is generally a bad thing because the number doesn't express what it is being used for. And is vulnerable to typos.
It's better to make a constant variable equal to the number, e.g.,
CONVERSION_RATE
, and use it instead, making the code clearer.I don't think it applies here, as 100 being used for percentage calculations is well known and it is hard to come up with a variable name for that 100.
I am not good in js. Can you please explain what is magic constants? Thanks.
Concerning code duplication, I have submitted a new solution that you might like better.
As for magic constants, are you talking about the value
100
? If it is not obvious that it is used to compute a percentage, it could be explained in a comment.But it's not best practice - code duplication and magic constants
Loading more items...