## Find the index of the element in an array which divides most elements before it

Given an array arr, the task is to find the index of the element in an array which divides most elements before it Examples: Input:… Read More »

- Kth smallest element in a subarray
- Find the smallest positive number missing from an unsorted array | Set 3
- Remove duplicates from unsorted array using Set data structure
- Pair with largest sum which is less than K in the array
- Find the minimum number of moves to reach end of the array
- Sum of digits with even number of 1's in their binary representation
- Minimum number of Fibonacci jumps to reach end
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Find sum of a[i]%a[j] for all valid pairs
- Find minimum changes required in an array for it to contain k distinct elements
- Maximum subsequence sum such that all elements are K distance apart
- Make the list non-decreasing by changing only one digit of the elements
- Queries for number of distinct elements in a subarray | Set 2
- Sort an array of strings according to string lengths using Map
- Count of triplets that satisfy the given equation
- Quadruplet pair with XOR zero in the given Array
- Number of Subsequences with Even and Odd Sum
- Find number of triplets in array such that a[i]>a[j]>a[k] and i<j<k
- Recursive program to find all Indices of a Number
- Find the sum of all possible pairs in an array of N elements
- Find the winner of the match | Multiple Queries
- Find subarray with given sum with negatives allowed in constant space
- Sum of the sums of all possible subsets
- Smallest element greater than X not present in the array
- Minimum Bitwise XOR operations to make any two array elements equal
- Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle
- Optimal Strategy for a Game | Set 3
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized

Given an array arr, the task is to find the index of the element in an array which divides most elements before it Examples: Input:… Read More »

Given an array of length N, the task is to find minimum operation required to make all elements in the array equal. Operation is as… Read More »

Given the size of a binary array consisting of 0’s only as n and an integer m which is the number of flips allowed from… Read More »

Given an array arr of N elements, the task is to find the length of the smallest subarray of the given array that contains at… Read More »

Given a 2D array of size N containing distinct height of people standing in a queue, and a number corresponding to each person (P) that… Read More »

Given a sequence A1, A2, A3, … An of distinct integers. The task is to find the last 2 remaining elements after removing the median… Read More »

Given an array arr[] of size N. The task is to find the size of the set of numbers from the given array such that… Read More »

Given an array arr[], the task is to check whether it is possible to make all the elements of the array zero by the given… Read More »

Given a permutation of integers from 1 to N and an integer M, the task is to check if any subarray of the given permutation… Read More »

Given an array arr[] of N distinct positive integers, let’s denote max(i, j) and secondMax(i, j) as the maximum and the second maximum element of… Read More »

Given a matrix of N rows and M columns, given two points on the matrix; the task is to count the number of cells that… Read More »

Given a sorted array of length ‘N’ and an integer ‘K'(K<N), the task is to remove exactly 'K' elements from the array such that sum… Read More »

Given an array arr[] of length N, the task is the find the length of the longest sub-array with maximum possible GCD value. Examples: Input:… Read More »

Given an array arr[] of length N, count the number of pairs (i, j) such that arr[i] * arr[j] = arr[i] + arr[j] and 0… Read More »

Given a binary matrix. In a single operation, you are allowed to choose two adjacent elements and invert their parity. The operation can be performed… Read More »