• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
August 26, 2024 |500 Views

PROBLEM OF THE DAY : 25/08/2024 | Number of pairs

Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Sorting but also build up problem-solving skills.

Given two positive integer arrays arr and brr, find the number of pairs such that xy > yx (raised to power of) where x is an element from arr and y is an element from brr.

Examples :

Input: arr[] = [2, 1, 6], brr[] = [1, 5] Output: 3 Explanation: The pairs which follow xy > yx are: 21 > 12,  25 > 52 and 61 > 16 .

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/number-of-pairs-1587115620/1