leetcode-775-Global and Local Inversions

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zem_nezer/article/details/86592475

It is my interview question, use merge sort!!! There are some property:
1. index of left is always less than right
2. since i < j, s.t. a[i] > a[j], so we just need to calculate when a[i] > a[j]
Error:
1. we need to first calculate local then global, since we use & for A
2. know what you are doing!!! You are calculating some index

猜你喜欢

转载自blog.csdn.net/zem_nezer/article/details/86592475