The j should start from the i+1, adjacent cell in the array?

On line 11, shouldn’t j be initilized as j=i+1?

@amandeepdogra65 yes it can start from both i or i+1 as if start from i result will be same