Inversion count in an given array is a very famous with a time complexity of O(NlogN). However, I wonder whether there is a way to do it with update. Input format: first line consist of an integer n; second line includes n integer which is the array the next line includes m the number of update the following m lines has intergers, x and y. You have to update the number at index x to y and output the number of inversion. Output: the output consist of m lines. one integer for each update/query
Can any help me to solve (#no offline programming)?