You are viewing a single comment's thread. Return to all comments →
solution from my side
count = 0 for i in range(1, len(arr)): key = arr[i] j = i - 1 while j >= 0 and key < arr[j]: count +=1 arr[j + 1] = arr[j] j -= 1 arr[j + 1] = key return count
Seems like cookies are disabled on this browser, please enable them to open this website
Running Time of Algorithms
You are viewing a single comment's thread. Return to all comments →
solution from my side