Question:- [ Ссылка ]
** Approach **
* Implement merge sort
* while comparing the temporary array elements
* when A1[i] is greater than A2[i], you have to add n1-i elements in the count, because all the elements from n1-i need to be inversed
because they meet the condition as mentioned in question i less than j && A[i] greater than A[j]
** Time Complexity **
O(N log N)
** Space Complexity **
O(N)
LinkedIn:- [ Ссылка ]
Instagram:- [ Ссылка ]
Ещё видео!