You are given an array of N numbers and a number K. Find the minimum number of swaps required to bring all the numbers greater than or equal to K together.
Swap here means, swapping value of array[i] and array[j], where 1≤i,j≤N
Input Format:
First line contains an integer N, denoting the number of elements in the array.
Second line contains N space-separated integers, denoting the elements of array.
Output Format:
Print the minimum number of swaps required.
Constraints:
1≤N≤105
1≤array[i]≤105
1≤K≤105
We need to bring 5,3 and 4 together. So swap 5 and 1.