## Rearrange an array such that product of every two consecutive elements is a multiple of 4

Given an array arr[] of size N, the task is to rearrange the array elements such that for every index i(1 <= i <= N… Read More »

- Sort an Array based on the absolute difference of adjacent elements
- Count of distinct XORs formed by rearranging two Binary strings
- Count of triplets of numbers 1 to N such that middle element is always largest
- Reorder an array such that sum of left half is not equal to sum of right half
- Maximize the number of indices such that element is greater than element to its left
- Maximum sum after rearranging the array for K queries
- Reorder an Array according to given indices with repetition allowed
- Arrange the array such that upon performing given operations an increasing order is obtained
- Maximize number of groups formed with size not smaller than its largest element
- Largest number in given Array formed by repeatedly combining two same elements
- Rearrange an array such that product of every two consecutive elements is a multiple of 4
- Sort Array such that smallest is at 0th index and next smallest it at last index and so on
- Minimize swaps to rearrange array such that parity of index and corresponding element is same
- Find initial sequence that produces a given Array by cyclic increments upto index P

Given an array arr[] of size N, the task is to rearrange the array elements such that for every index i(1 <= i <= N… Read More »

Given an array, arr[] of N integers, the task is to rearrange the array elements such that the smallest element is at the 0th position,… Read More »

Given an array arr[] consisting of N elements and an integer P, the task is to find the initial array from which given arr[] is… Read More »

Given an array A[], the task to find minimum swapping operations required to modify the given array A[] such that for every index in the… Read More »

Given an array arr[] of even length, the task is to check whether is it possible to reorder the array element such that the sum… Read More »

Given an integer N, the task is to count the number of ways to arrange triplets (a, b, c) within [1, N] in such a… Read More »

Given an array arr[] of N positive integers(1 ≤ arr[i] ≤ N ), divide the elements of the array into groups such that the size… Read More »

Given two integer arrays arr and index of size N, the task is to create a new array by inserting the elements given in the… Read More »

Given an array arr[] containing N integers, the task is to rearrange all the elements of array such that absolute difference between consecutive elements of… Read More »

Given an array arr[] of N integers, the task is to maximize the number of indices such that an element is greater than the element… Read More »

Given two arrays arr[] containing N integers and Q[][] containing K queries where every query represents a range [L, R]. The task is to rearrange… Read More »

Given two binary strings A and B of equal length N, the task is to find the number of distinct XORs possible by arbitrarily reordering… Read More »

Given an array arr[], the task is to find the largest number in given Array, formed by repeatedly combining two same elements. If there are… Read More »

Given an array arr[] of size N, the task is to print the arrangement of the array such that upon performing following operations on this… Read More »

Given an array arr[] of integers, the task is to arrange them in a way similar to the to-and-fro movement of a Pendulum without using… Read More »