## Lexicographical smallest alternate Array

Given an array arr[] of distinct elements, the task is to rearrange the array such that it is lexicographically smallest and of the form arr… Read More »

## Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle

Given N bottles. The ith bottle has A[i] radius. Once a bottle is enclosed inside another bottle, it ceases to be visible. The task is… Read More »

## Find the smallest positive number missing from an unsorted array | Set 3

Given an unsorted array with both positive and negative elements. The task is to find the smallest positive number missing from the array. Examples: Input:… Read More »

## Find the winner of the match | Multiple Queries

Given an array of pairs arr of size N which represents a game situation where the first player wins against the second player. Given multiple… Read More »

## Sum of the sums of all possible subsets

Given an array a of size N. The task is to find the sum of the sums of all possible subsets. Examples: Input: a[] =… Read More »

## Longest alternative parity subsequence

Given an array a of size N. The task is to print the length of the longest alternative odd/even or even/odd subsequence. Examples: Input: a[]… Read More »

## Print the lexicographically smallest array by swapping elements whose sum is odd

Given an array of N integers. The task is to find the lexicographically smallest array possible by applying the given operation any number of times.… Read More »

## Subsequence X of length K such that gcd(X, X) + (X, X) + … is maximized

Given an array a of size N. The task is to find a subsequence X of length K such that gcd(X, X) + (X, X)… Read More »

## Find the maximum elements in the first and the second halves of the Array

Given an array arr[] of N integers. The task is to find the largest elements in the first half and the second half of the… Read More »

## Print all the peaks and troughs in an Array of Integers

Given an array of integers arr[], the task is to print a list of all the peaks and another list of all the troughs present… Read More »

## Sum of even elements of an Array using Recursion

Given an array arr[] of integers, the task is to find the sum of even elements from the array. Examples: Input: arr[] = {1, 2,… Read More »

## Maximum number of elements without overlapping in a Line

Given two arrays X and L of same size N. Xi represents the position in an infinite line. Li represents the range up to which… Read More »

## Maximum Bitwise AND value of subsequence of length K

Given an array a of size N and an integer K. The task is to find the maximum bitwise and value of elements of any… Read More »

## Product of Primes of all Subsets

Given an array a[] of size N. The value of a subset is the product of primes in that subset. A non-prime is considered to… Read More »

## Maximum value of division of two numbers in an Array

Given an array A of size N (> 2). The task is to find the maximum value of A[i] / A[j] Note: A[i] ≠ 0.… Read More »