In the five blanks given in the question, the last two blanks must be $temp$ and $i+1$ because all the given options for the fourth and fifth blanks have $temp$ and $i+1$.
Now, for the first blank, it must be $ i<min$ because if it is $i>min$ then the control goes out of the while loop in the initial case when $i=0$ and $min=n$
So, the first blank is $i<min$ which implies either option $B$ or option $D$ is correct.
Assume option $B$ is correct then in the bracket of while we have $ j!= (n+i) mod n$
That means whenever $j$ becomes equal to $(n+i)mod n$ then control goes out of the while loop.
Now $(n+i)mod n = i$ and $j$ is always equal to $ i$ because in line 3 of the code we are assigning the value of $i$ to $j$.
So, if option $B$ is true control never enters the second while loop but it has to enter the second while loop to shift the nos. $K$ places left.
Hence, option D is correct.