Select numbers in such way to maximize the amount of money

Given two arrays A1 and A2 of N numbers. There are two people A and B who select numbers out of N. If A selects… Read More »

Minimum number of elements that should be removed to make the array good

Given an array arr[], the task is to find the minimum number of elements that must be removed to make the array good. A sequence… Read More »

Shortest path to traverse all the elements of a circular array in increasing order

There are N distinct integers arranged on a circle. The distance between any two adjacent numbers is 1. The task is to travel on this… Read More »

Minimum elements to be removed such that sum of adjacent elements is always odd

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

Count all possible N digit numbers that satisfy the given condition

Given an integer N, the task is to count all possible N digit numbers such that A + reverse(A) = 10N – 1 where A… Read More »

Maximum sub-array sum after dividing array into sub-arrays based on the given queries

Given an array arr[] and an integer k, we can cut this array at k different positions where k[] stores the positions of all the… Read More »

Find Intersection of all Intervals

Given N intervals of the form of [l, r], the task is to find the intersection of all the intervals. An intersection is an interval… Read More »

Choose points from two ranges such that no point lies in both the ranges

Given two segments [L1, R1] and [L2, R2], the task is to choose two elements x and y from both the ranges (one from range… Read More »

Maximum size of sub-array that satisfies the given condition

Given an array arr[] of integers. The task is to return the length of the maximum size sub-array such that either one of the condition… Read More »

Maximum count of sub-strings of length K consisting of same characters

Given a string str and an integer k. The task is to count the occurrences of sub-strings of length k that consist of the same… Read More »

Maximum number of teams that can be formed with given persons

Given two integers N and M which denote the number of persons of Type1 and Type2 respectively. The task is to find the maximum number… Read More »

Count of alphabets whose ASCII values can be formed with the digits of N

Given an integer N. You can select any two digits from this number (the digits can be same but their positions should be different) and… Read More »

Form lexicographically smallest string with minimum replacements having equal number of 0s, 1s and 2s

Given a string str of length n (n is a multiple of 3) containing characters only from the set {0, 1, 2}. The task is… Read More »

Find the Side of the smallest Square that can contain given 4 Big Squares

Given sides of four small squares. You have to find the side of the smallest square such that it can contain all given 4 squares… Read More »

Rectangle with minimum possible difference between the length and the width

Given an integer area, the task is to find the length and breadth of a rectangle with the given area such that the difference between… Read More »