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.
Me and my 60 lines of code ...
It is faster, but it's very hard to read through tbh... I'd rather have 5 more lines to read through easily than 1 line to read for like an hour and thinking what tf does it do tho :P
For example, if you have a loop that calculates Math.floor(integer / 2) in each iteration, and this value doesn't change throughout the loop, you can calculate it once before the loop and then use the precalculated value inside the loop. This can improve the performance of your code, especially for large numbers or when the loop is executed many times.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
it's because 2x faster than your solution. :)
This comment is hidden because it contains spoiler information about the solution
The idea is somewhat similar to the most of the solutions, but i don not understand why it is best practise. Maybe because it is shorter in terms of code length or smth else
nice point to consider
This comment is hidden because it contains spoiler information about the solution
it looks good and all, but there is still that undefined is prime error when you input different data type or less than 2
I think they divided by 2 because the smallest divisor you can have is 2 or above meaning all numbers will be less than x/2 and flooring it was because divisors are only full numbers. The question mark is an if statement. First you have your statement then the question mark then the code to be ran if true and the colon is an else followed by the code for the else
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...