## 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 »

- Coin game of two corners (Greedy Approach)
- Kruskal's Algorithm (Simple Implementation for Adjacency Matrix)
- Dijkstra's shortest path with minimum edges
- Final cell position in the matrix
- Minimum number of sets with numbers less than Y
- Remove exactly one element from the array such that max - min is minimum
- Value in a given range with maximum XOR
- CPU Scheduling | Longest Remaining Time First (LRTF) Program
- Check if an array is Wave Array
- Check if it is possible to sort the array after rotating it
- Minimum cost to reach a point N from 0 with two different operations allowed
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Prim's Algorithm (Simple Implementation for Adjacency Matrix Representation)
- Maximum sum by picking elements from two arrays in order
- Maximize the profit by selling at-most M products
- Minimize the maximum minimum difference after one removal from array
- Minimum Increment / decrement to make array elements equal
- Find length of longest Fibonacci like subsequence
- Rectangle with minimum possible difference between the length and the width
- Subarray whose absolute sum is closest to K
- Longest subsequence whose average is less than K
- Count valid pairs in the array satisfying given conditions
- Maximum litres of water that can be bought with N Rupees
- Find maximum distance between any city and station
- Maximum sum of all elements of array after performing given operations
- Count all possible N digit numbers that satisfy the given condition
- Minimum number of 1's to be replaced in a binary array
- Minimize the difference between minimum and maximum elements
- Count subarrays with Prime sum
- Minimum number of operations required to reduce N to 1

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »