Given an integer array of length , return true if the number of global inversions equals the number of local inversions.
A global inversion is a pair where and . A local inversion is an index where . Every local inversion is a global inversion.
The question asks: are all global inversions local? Use BIT to count global inversions, then check if it equals the local count. Constraints: up to .