I understand this is a code to check if elements in the list are different. But the while loop is aspect is confusing. Can someone explain this part
// Input: list (or array) of n integers a[0]; a[1]; a[2],....., a[n − 1]
// Output: Does there exist a repeated integer in the list?
repeat ← false
i ← 0 // set i to zero
while i <= n − 2 do
j ← i + 1
while j <= n − 1 do
if (a[i] == a[j]) then
repeat ← true
else
repeat ← false
j ← j + 1
i ← i + 1
if (repeat == true) then
print "Some numbers repeated"
else
print "All numbers are different"