Weird solution of this basic problem


#1

The solution doesnt make sense. Why is the value of i in the 2nd and 3rd iteration the same?


#2

The solution talks about all iterations in the program. The second iteration talks about i = 1 and j = 0 while the third one talks about i = 1 and j = 1. Here the inner loop is taken into consideration. Hope this helps!