• Custom User Avatar

    here -> ;

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You can initialize i to 1 as a minor optimization. Adding 0 to the sum isn't necessary.

  • Custom User Avatar

    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).

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Ok, i made for into a for, so it could made performence issue. Can you give me w hint for another way?

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    Agreed. No idea what is being asked

  • Custom User Avatar

    cauli: Could you write to the administrator with this situation?

  • Custom User Avatar

    Me two. Do you know how can i solve it?

  • Loading more items...