Minimum operations to sort an array

Правка en1, от vaibhavmisra, 2021-11-13 06:48:57

Operation : Change any array element to arbitrary integer, O(N^2) would give TLE, My approach : ans = Length of array — Length of longest non-decreasing sub-sequence because I want maximum length already sorted, TC : O(NlgN),
Is this approach correct? Any other approaches?

Теги lis, sorting

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vaibhavmisra 2021-11-13 06:48:57 334 Initial revision (published)