Chef and Girlfriend SOLUTIONS CHEF1005

Chef and Girlfriend SOLUTION

At whatever point Chef requests that his Girlfriend hang out, she’s caught up with accomplishing her work. Culinary expert needs to assist her with completing it quicker, however he’s stuck between a rock and a hard place! Would you be able to assist Chef with understanding his Girlfriend’s work so she can spend time with him? 

Consider a variety of n particular numbers, array=[a[0]……a[n−1]]. Cook can trade any two components of the exhibit quite a few times given 0<i<n among is negligible. 



The primary line contains a solitary integer,n , the quantity of components in exhibit. The subsequent line contains space-isolated numbers array[i]. 



Return the base number of trades expected to make the exhibit delightful. 




1≤array[i] ≤2X105 


Test Input: 

2 5 3 1 

Test Output:


Leave a Comment