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.
here -> ;
This comment is hidden because it contains spoiler information about the solution
You can initialize i to 1 as a minor optimization. Adding 0 to the sum isn't necessary.
Yeah, that lockers array will get too large.
As I said, just do the problem by hand for a bunch of examples.
If you need an additional tip, think about the numbers which have odd number of divisors.
(Usually, numbers have an even number of divisors as for every i, there is n/i).
This comment is hidden because it contains spoiler information about the solution
By a for in a for, do you mean a nested loop?
Am I correct in assuming you are simulating the entire process?
Try a few examples by hand, and look at the numbers on the lockers which are left open.
The pattern is impossible to miss.
Ok, i made for into a for, so it could made performence issue. Can you give me w hint for another way?
The 6000ms timeout is there to test performance.
The main tests are obviously bigger than the example tests.
You need to optimize your code by thinking up a better way to solve the problem.
It's most likely your program. Do you make an array of numbers upto the given number?
Because it goes upto 1e9. Your program might use too much memory if you do that.
I pass 9 tests and then gets "FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory" and nothing else.
So i don't know it's some kind of bug i do, or it's performence issue, or it's kata problem?
This comment is hidden because it contains spoiler information about the solution
var self = this;
used to widely agreed as the best practice for performing a closure.bind(this)
is starting to gain acceptance as IE8 is dropping off the map.Referencing the variables directly is largely bad design, because if a developer changed "alpha" to another variable, some IDEs may not pick up on the refactor of the nested "alpha" in an anonymous function.
Agreed. No idea what is being asked
cauli: Could you write to the administrator with this situation?
Me two. Do you know how can i solve it?
Loading more items...