• + 1 comment

    You missed the bounds checks.

    if (n >= 1 || n  <= 1000) {...