Problem Submissions Solution

Number of Pairs

Difficulty: Medium

Acceptance: %

Points: 30.00

Given two positive integer arrays arr and brr, determine the number of pairs (x, y) such that x^y > y^x, where x is an element from arr and y is an element from brr.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O((N + M)log(N)).

Expected Auxiliary Space: O(1).

Constraints:
  • 1 <= arr.size(), brr.size() <= 10^5
  • 1 <= brr[i], arr[i] <= 10^3
Companies:
Samsung Visa IBM Yahoo
Topics:
Array
Locked Content
Access Restricted: Please Login to access the code editor and test cases.