News for hackers. Stuff that matters.
Re:Is the room open? by akovaski on Monday February 10, 2020 @01:09PM (#22291582)
The +1 makes the range inclusive rather than exclusive. This matches the summary, which is inclusive of floor(500/k). Ceil wouldn't correctly handle the case where the number of rooms equals a perfect square. That is,

  [k**2 for k in range(1, ceil(484**0.5))]
does not return 484.
Re:Is the room open? by geocar on Monday February 10, 2020 @01:43PM (#22291927)
Quite right! So a 1+ is needed.

I can't amend my comment to that point, but the original comment didn't have +1 in there anyway.