## Find GCD of factorial of elements of given array

Given an array with N positive integers. Find the GCD of factorials of all elements of array. Examples: Input : arr[] = {3, 4, 8,… Read More »

## Find m-th smallest value in k sorted arrays

Given k sorted arrays of possibly different sizes, find m-th smallest value in the merged array. Examples: Input: m = 5 arr[][] = { {1,… Read More »

## Print all the sum pairs which occur maximum number of times

Given an array arr[] of N distinct integers. The task is to find the sum of two array integers a[i] + a[j] which occurs maximum… Read More »

## Print direction of moves such that you stay within the [-k, +k] boundary

Given an array arr[] of N positive integers and an integer K. It is given that you start at position 0 and you can move… Read More »

## Sum of all odd factors of numbers in the range [l, r]

Given a range [l, r], the task is to find the sum of all the odd factors of the numbers from the given range. Examples:… Read More »

## Check for an array element that is co-prime with all others

Given an array arr[] of positive integers where 2 ≤ arr[i] ≤ 106 for all possible values of i. The task is to check whether… Read More »

## Minimize sum of adjacent difference with removal of one element from array

Given an array of positive integers of size greater than 2. The task is to find the minimum value of sum of consecutive difference modulus… Read More »

## Maximum subarray sum by flipping signs of at most K array elements

Given an array arr[] of N integers and an integer K. The task is to find the maximum sub-array sum by flipping signs of at… Read More »

## Missing even and odd elements from the given arrays

Given two integer arrays even[] and odd[] which contains consecutive even and odd elements respectively with one element missing from each of the arrays. The… Read More »

## Total character pairs from two strings, with equal number of set bits in their ascii value

Given two strings s1 and s2. The task is to take one character from first string and one character from second string and check if… Read More »

## Count all elements in the array which appears at least K times after their first occurrence

Given an array arr[] of N integer elements and an integer K. The task is to count all distinct arr[i] such that arr[i] appears at… Read More »

## Pick points from array such that minimum distance is maximized

Given C magnets and an array arr[] representing N index positions where C ≤ N. The task is to place these magnets at these available… Read More »

## Two equal sum segment range queries

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

## Longest subsequence such that adjacent elements have at least one common digit

Given an array arr[] of N integers, the task is to find the length of the longest sub-sequence such that adjacent elements of the sub-sequence… Read More »

## Sum of even values and update queries on an array

Given an array arr[] of integers and an array q[] of queries. For the ith query, index = q[i] and value = q[i]. The task… Read More »