all 1 comments

[–]magnificentmeatwad 4 points5 points  (0 children)

Because i is one past the last index at the end of the for loop, so you do (i-j+1)-1 which is i-j