Given two arrays with unequal sizes, you have to take one element from first array(say a) and one element from array 2(say b). If the sum of a and b is a Read more →
Arrays
106 postsYou are given a positive integer n, and an array a of positive integers. Find number of such pairs (i,j) such that i<j and ai & aj ≥ ai ^ aj, where Read more →
Far away in Lonely lands of Punjab’s village there lived mathematically advanced guy. Let’s call him the lost guy because he remains lost in his Mathematical courses.One of the games he is Read more →
Given an array Arr[N] of integers, where N is the size of the array. Our task is to rearrange the array such that arr[i]%2 = i%2, in other words, the element at Read more →
You are provided with an array of size 8*N and you are provided a permutation of 8*N consecutive integers comprising of all the elements from ‘a’ to ‘a + 7*N ‘. Your Read more →
Given an array with all distinct elements, you need to find the occurrence of every element among all the possible subarrays of the array. Examples: Input: arr[] = { 2 , 1 Read more →
Given the Numerator and Denominator of N Rational Numbers, the task is to find the maximum Rational Number from the array. Examples: Input: N = 2 num[] = { 3, 3 } Read more →
Given an integer array and a positive integer k, count all distinct pairs with product equal to k. Examples: Input: arr[] = {2, 6, 4, 3, 1}, k = 12 Output: Count Read more →
Given an array arr[] of integer elements, the task is to find the length of the largest sub-array of arr[] such that all the elements of the sub-array are Fibonacci numbers. Examples: Read more →
Given an array containing n numbers. The problem is to find the length of the longest zigZag subarray such that every element in the subarray should be in form a < b Read more →