## Maximize number of elements from Array with sum at most K

Given an array A[] of N integers and an integer K, the task is to select maximum number of elements from the array whose sum… Read More »

- Minimize the maximum difference between adjacent elements in an array
- Number of pairs in an array with the sum greater than 0
- Minimum salary hike for each employee such that no employee feels unfair
- Extended Knapsack Problem
- Huffman Coding using Priority Queue
- Maximum profit by buying and selling a share at most K times | Greedy Approach
- Find lexicographically smallest string in at most one swaps
- Why Prim’s and Kruskal's MST algorithm fails for Directed Graph?
- Shortest path in a directed graph by Dijkstra’s algorithm
- Find the Mth element of the Array after K left rotations
- Sum of all subarrays of size K
- Count subarrays having sum of elements at even and odd positions equal
- Maximum size of square such that all submatrices of that size have sum less than K
- Longest increasing sub-sequence formed by concatenating array to itself N times
- Count the elements having frequency equals to its value
- Maximum Possible Rating of a Coding Contest
- Count number of triangles possible for the given sides range
- Minimum cost to make an Array a permutation of first N natural numbers
- Find the maximum sum (a+b) for a given input integer N satisfying the given condition
- Number of containers that can be filled in the given time
- Proof that traveling salesman problem is NP Hard
- Queries to check if any non-repeating element exists within range [L, R] of an Array
- Lexicographical smallest number after at most K consecutive swaps
- Count of N digit Numbers whose sum of every K consecutive digits is equal
- Find the largest number smaller than integer N with maximum number of set bits
- Length of the Smallest Subarray that must be removed in order to Maximise the GCD
- Find subarray of Length K with Maximum Peak
- Minimum number of colors required to color a Circular Array
- Maximum sum subarray of size range [L, R]
- Replace each element of Array with it's corresponding rank

Given an array A[] of N integers and an integer K, the task is to select maximum number of elements from the array whose sum… Read More »

Given an integer K, the task is to find a pair of numbers (A, B) such that A – B = K and A /… Read More »

Given a natural number N, the task is to find a number M smaller than N such that the difference between their bitwise XOR (N… Read More »

Given a number N and a prime number P, the task is to find the sum of largest divisors of each number in the range… Read More »

Given a number N and a time X unit, the task is to find the number of containers that are filled completely in X unit… Read More »

Given two integers N and M, where N denotes the count of ‘0’ and M denotes the count of ‘1’, and an integer K, the… Read More »

Given a character C and a string S, the task is to remove the first and last occurrence of the character C from the string… Read More »

Given two integers N and M, the task is to construct a binary string with the following conditions : The Binary String consists of N… Read More »

Given an array arr[] of N elements, the task is to derive a MultiSet having the numbers from the given array in possible repetitions, such… Read More »

Given an integer N, the task is to construct a matrix M[][] of size N x N with numbers in range [1, N^2], such that… Read More »

Given an array arr[] consisting of N distinct integers and an integer K, the task is to find the maximum size of a subset possible… Read More »

Given matrices txt[][] of dimensions m1 x m2 and pattern pat[][] of dimensions n1 x n2, the task is to check whether a pattern exists… Read More »

Given a string S, the task is to change the string id it doesn’t follow any of the rules given below and print the updated… Read More »

Given two strings str1 and str2, the task is to check if any permutation of the given strings str1 and str2 is possible such that… Read More »

Given two arrays start[] and end[] consisting of positive integers denoting the starting and ending points of a segment respectively, the task is to find… Read More »