also they have asked to change the value of those variables. for the first iteration of j when j=0 (5) arr = [8, 2, 4, 1, 3] 8,2 you need to compare the values of arr[j] and arr[j+1] and if the value of 8 is greater than 2 then the value should change from 8 to 2 and that is the reason why we are creating a temp variable so the value 8 does not get lost.