this easy version problem in version number give array distinct constraint n hard version problemyou give array n integer equal element array you perform follow operation array element choose index 1 le le n element ai begin array choose index 1 le le n element ai end array for example n 5 4 7 2 3 9 follow sequence operation perform perform operation type second element array 7 4 2 3 9 perform operation second type second element array 7 2 3 9 4 you perform operation type number time orderfind minimum total number operation second type array sort nondecrease order in word minimum number operation perform array satisfie inequalitie a1 le a2 le ldots le