## Maximum possible difference of two subsets of an array

Suppose, we have an integer array. The problem statement “Maximum possible difference of two subsets of an array” asks to find out the maximum possible difference between the two subsets of an array. Conditions to be followed: An array can contain repeating elements, but the highest frequency of an element …

## Given an Array of Pairs Find all Symmetric Pairs in it

Find all symmetric pairs – You are given some pairs of an array. You have to find out the symmetric pairs in it. The symmetric pair is said to be symmetric when in pairs say (a, b) and (c, d) in which ‘b’ is equal to ‘c’ and ‘a’ is …

## GCDs of given index ranges in an array

Problem Statement   The problem ‘GCDs of given index ranges in an array” states that you are given an integer array and some range queries. The problem statement asks to find out the Greatest Common Divisor of the sub-array so formed within the range. Example   arr[] = {10, 5, 18, 9, …

## Permutation Coefficient

Problem Statement   In this problem “Permutation Coefficient”, we need to find it when we are given the values of n & k. Example   n = 5, k = 2 20 Explanation: This value of n P r is found using the formula of the permutation coefficient.  nPr = n!/(n-r)! Approach …

## Binomial Coefficient

Problem Statement   Find the Binomial Coefficient for a given value of n and k. “In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers n ≥ k ≥ 0 and is written as ” – quoted from Wikipedia. Example   n = 5, k …

## Implementation of Deque using Doubly Linked List

Problem Statement   The problem “Implementation of Deque using Doubly Linked List” states that you need to implement the following functions of Deque or Doubly Ended Queue using a doubly linked list, insertFront(x) : Add element x at the starting of Deque insertEnd(x) : Add element x at the end of …

## Convert array into Zig-Zag fashion

Problem Statement   The problem “Convert array into Zig-Zag fashion” states that you are given an – of integers. The problem statement asks to sort the array in a zig-zag manner such that the elements in the array will look like à  a < b > c < d > e …

## Remove duplicates from sorted array

Problem Statement   “Remove duplicates from sorted array” states that you are given a sorted array of size N. You need to remove the duplicate elements from the array. Print the array containing unique elements after the removal of duplicate elements. Example   a [] = {1, 1, 1, 1} {1} Explanation: …

## Numbers with prime frequencies greater than or equal to k

Problem Statement   Problem “Numbers with prime frequencies greater than or equal to k” states that you are given an array of integers size n and an integer value k. All the numbers inside it are prime numbers. The problem statement asks to find out the numbers which appear in the …

## Convert an array to reduced form

Problem Statement   Problem “Convert an array to reduced form” states that you are given an array of integers of size n distinct elements. The problem statement asked to reduce the array in such a way that the new numbers be placed in the array within the range 0 to n-1. …