Given an array arr[] of distinct integers of size n and a value sum, the task is to find the count of triplets (i, j, k), having (i<j<k) with the sum of (arr[i] + arr[j] + arr[k]) smaller than the ...
Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i]. To the right of 5 there are 2 smaller elements (2 and 1). To the ...