Help me in solving SESO23 problem

My issue

key = A[i]
while j >= 0 and A[j] > key
j = j - 1
for i = 1 to length(A) - 1
end while
A[j + 1] = A[j]
end for
j = i - 1
A[j + 1] = key

arrange in proper odder

Learning course: Searching and Sorting Algorithms
Problem Link: Insertion Sort in Searching and Sorting Algorithms