## Calculate the loss incurred in selling the given items at discounted price

A seller wants to sell his items at a discount of X%. He increases the price of each item by X% of the original price.… Read More »

## Maximum absolute difference in an array

Given an array arr[] of N integers, the task is to find the maximum absolute difference between any two elements of the array. Examples: Input:… Read More »

## Building Heap from Array

Given an array of N elements. The task is to build a Binary Heap from the given array. The heap can be either Max Heap… Read More »

## Maximize the maximum subarray sum after removing atmost one element

Given an array arr[] of N integers. The task is to first find the maximum sub-array sum and then remove at most one element from… Read More »

## Number of subsequences with zero sum

Given an array arr[] of N integers. The task is to count the number of sub-sequences whose sum is 0. Examples: Input: arr[] = {-1,… Read More »

## Find the maximum possible value of a[i] % a[j] over all pairs of i and j

Given an array arr[] of N positive integers. The task is to find the maximum possible value of a[i] % a[j] over all pairs of… Read More »

## Count of elements whose absolute difference with the sum of all the other elements is greater than k

Given an array arr[] of N integers and an integer K, the task is to find the number of anomalies in the array. An anomaly is a number for… Read More »

## Divide array into increasing and decreasing subsequence without changing the order

Given a merged sequence which consists of two sequences which got merged, one of them was strictly increasing and the other was strictly decreasing. Elements… Read More »

## Minimum sub-array such that number of 1’s in concatenation of binary representation of its elements is at least K

Given an array arr[] consisting of non-negative integers and an integer k. The task is to find the minimum length of any sub-array of arr[]… Read More »

## Find a Symmetric matrix of order N that contain integers from 0 to N-1 and main diagonal should contain only 0’s

Given an integer N. The task is to generate a symmetric matrix of order N*N having the following properties. Main diagonal should contain only 0’s… Read More »

## Count the number of sub-arrays such that the average of elements present in the sub-array is greater than that not present in the sub-array

Given an array of integers arr[], the task is to count the number of sub-arrays such that the average of elements present in the sub-array… Read More »

## Find the number of sub arrays in the permutation of first N natural numbers such that their median is M

Given an array arr[] containing the permutation of first N natural numbers and an integer M ≤ N. The task is to find the number… Read More »

## Split the array elements into strictly increasing and decreasing sequence

Given an array of N elements. The task is to split the elements into two arrays say a1[] and a2[] such that one contains strictly… Read More »

## Check if the given Binary Expressions are valid

Given n expressions of the type x = y and x != y where 1 ≤ x, y ≤ n, the task is to check… Read More »

## Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array

Given N elements, you can remove any two elements from the list, note their sum and add the sum to the list. Repeat these steps… Read More »