Minimum adjacent swaps required to Sort Binary array
Given a binary array, the task is to find the minimum number of swaps needed to sort this binary array. We are allowed to swap only adjacent elements. Examples: Input : arr[] = [0, 0, 1, 0, 1, 0, 1, 1]Output : 3Explanation:1st swap : [0, 0, 1, 0, 0, 1, 1, 1]2nd swap : [0, 0, 0, 1, 0, 1, 1, 1]3rd swa