• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
April 23, 2024 |450 Views

SDE Sheet - Number of pairs

  Share   Like
Description
Discussion

This video is part of Hahisng section under GFG SDE Sheet.

In this problem, we are an two positive integer arrays X of size M and Y of size N, find the number of pairs such that xy > yx (raised to power of) where x is an element from X and y is an element from Y.

Example :

Input: 
M = 3, X[] = [2, 1, 6] 
N = 2, Y[] = [1, 5]
Output: 3

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/find-number-pairs-xy-yx/
Problem: https://www.geeksforgeeks.org/problems/number-of-pairs-1587115620/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/