Uber 2023-March | Fenwick Trees & Coordinate Compression

Uber · Question · Posted Jun 2026

Question 1: Global Inversions Problem Statement You are given an array A of N integers. You need to count the total number of inversions in the array. An inversion is defined as a pair of indices (i, j) such that i < j and A[i] > A[j]. Input Format The first line contains T - the number of test cases. The first line of each testcase contains a single integer N - the size of the array. The second line ...

The full answer & interview discussion are available to premium members.

Log in Create a free account