Pair of Pairs
Question · Posted May 2023
Question : Pair of pairs Given Q pairs in the form of (L. R) where all L values are pairwise distinct from each other and an array A of size N. Find out the total number of pairs (I, j) where i < j and (A/ |]. AJ should be equal to exactly one of the given Q pairs. Notes • 1-based indexing is followed. • For two indices i, J where i < J. (A;, A j) is considered ...
The full answer & interview discussion are available to premium members.
Log in Create a free account