If you set j = i then the minimum distance would be zero since you’d be computing the distance between a point with itself!
If you set j = 0 the above would still apply, albeit with unnecessary duplicated comprisons, since you’d be including j == i.
solved what happens when we change the value which is in loop? [closed]