## Length and Breadth of rectangle such that ratio of Area to diagonal^2 is maximum

Given an array of positive integers. The task is to choose a pair of elements from the given array such that they represent the length… Read More »

- Coin game of two corners (Greedy Approach)
- Final cell position in the matrix
- Kruskal's Algorithm (Simple Implementation for Adjacency Matrix)
- Check if an array is Wave Array
- Dijkstra's shortest path with minimum edges
- Check if it is possible to sort the array after rotating it
- Value in a given range with maximum XOR
- Longest subsequence whose average is less than K
- Water drop problem
- Minimum cost to reach a point N from 0 with two different operations allowed
- Prim's Algorithm (Simple Implementation for Adjacency Matrix Representation)
- Count valid pairs in the array satisfying given conditions
- Maximum sum by picking elements from two arrays in order
- Subarray whose absolute sum is closest to K
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Minimum Increment / decrement to make array elements equal
- Minimum number of 1's to be replaced in a binary array
- Maximize the profit by selling at-most M products
- Minimum time to reach a point with +t and -t moves at time t
- Maximum sum of all elements of array after performing given operations
- Least Greater number with same digit sum
- Minimum number of bottles required to fill K glasses
- Check if a string can be rearranged to form special palindrome
- Minimum number of adjacent swaps for arranging similar elements together
- Lexicographically smallest permutation of a string with given subsequences
- Minimum boxes required to carry all gifts
- Maximum litres of water that can be bought with N Rupees
- Minimum swaps required to make a binary string alternating
- Minimize the difference between the maximum and minimum values of the modified array
- Check if a number has digits in the given Order

Given an array of positive integers. The task is to choose a pair of elements from the given array such that they represent the length… Read More »

Given an array of N positive integers and Q queries consisting of an integer K, the task is to print the length of the longest… Read More »

Given an array containing N integers. The task is to find the sum of the elements of the contiguous subarray having the smallest(minimum) sum. Examples:… Read More »

Given two arrays of size N, and two numbers X and Y, the task is to maximize the sum by considering the below points: Pick… Read More »

Given an array of pairs where each pair represents a range, the task is to find the sum of the minimum difference between the consecutive… Read More »

Given a number N, place numbers from the range [1, N2] in an NxN matrix such that sum in every row is equal. Examples: Input:… Read More »

Consider a pipe of length L. The pipe has N water droplets at N different positions within it. Each water droplet is moving towards the… Read More »

Given two arrays arr1[] and arr2[] sorted in ascending order and an integer K. The task is to find k pairs with smallest sums such… Read More »

Given an array of N elements. The task is to print the maximum number by concatenating every element in each rotation. In every rotation, the… Read More »

Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to… Read More »

Given an array of 2 * N positive integers where each array element lies between 1 to N and appears exactly twice in the array.… Read More »

Given an array of N elements where the first element is a non zero positive number M, and the rest N – 1 elements are… Read More »

Given an unsorted array of length N and we have to find largest gap between any two elements of array.In simple words, find max(|Ai-Aj|) where… Read More »

Given an array of size 2 * N integers. Divide the array into N pairs, such that the maximum pair sum is minimized. In other… Read More »

Given programs stored on a computer tape and length of each program is where , find the order in which the programs should be stored… Read More »