It's been a while, but you're right and your solution is easier to read
Not clear why the invariant checks for n > 0 when i is always at least 1 and it already checks for i <= n...
Good Optimized and Balanced Code!
Though still there is a little optimization))
Definitely Best Practice and do vote for Best Performance without vectors.
Best Practice
Best Performance
The best one!
Loading collection data...
It's been a while, but you're right and your solution is easier to read
Not clear why the invariant checks for n > 0 when i is always at least 1 and it already checks for i <= n...
Good Optimized and Balanced Code!
Though still there is a little optimization))
Definitely
Best Practice
and do vote forBest Performance
without vectors.The best one!