Ad
  • Custom User Avatar

    So in the description, when you write:

    "The equation could be stated as follows:

    Johnny runs down the row of lockers n times, starting at the first locker each run and skipping i lockers as he runs, where n is the number of lockers there are in total and i is the current run."

    you actually mean:

    " ... starting at the ith locker each run and skipping i lockers as he runs ... "

    You really need to change the description. Perhaps you mean "start skipping locker numbers" at the first locker, but most native english speakers would interpret your words as "start flipping lockers" at the first locker. Also, you need to specify that all the lockers start out closed!

  • Custom User Avatar

    Because there is an edge condition that loops forever on your first while loop.

    (I don't know why your Sublime isn't looping forever on this.)

  • Custom User Avatar

    Why is locker 3 being affected at the second run? It goes:

    First run
    1-2-3-4-5...
    Second run
    2-4-6-8-10...
    Third run
    3-6-9...