Minimum Cost to sort an array either ascending or descending
Разница между en2 и en3, 80 символ(ов) изменены
Given an array of integers ,the cost to change an element is abs(newvalue — initialvalue) .Determine the **minimum cost** to sort the array either ascending or descending .↵

1<=n<=1e3↵
1<=arr[i]<=1e9↵

I couldnt find its solution after so much brainstorming can anyone help me out with its solution?↵

![question](/predownloaded/f2/f1/f2f119fbb35903d45871beae8e90bb41bae5f420.jpg)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский LIT2021015_AYUSH 2024-04-27 22:46:36 80
en2 Английский LIT2021015_AYUSH 2024-04-27 21:15:40 82 Tiny change: ' solution?' -> ' solution?\n\n![question](https://mirror.codeforces.com/433409/1111.jpg)'
en1 Английский LIT2021015_AYUSH 2024-04-27 21:13:43 368 Initial revision (published)