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 →
Data Structures
5 postsGiven 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 →
Given a string of length, N finds the minimum number of characters needed to delete to make right and left shift of the remaining string equal. Examples : Input : str: "36363636" 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 →
Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print final distance matrix. From any cell (i,j), Read more →