## Order of indices which is lexicographically smallest and sum of elements is <= X

Given an array arr[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… Read More »

- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Find maximum meetings in one room
- Greedy approach vs Dynamic programming
- Largest substring with same Characters
- Find minimum changes required in an array for it to contain k distinct elements
- Maximum Length Chain of Pairs | Set-2
- Minimum number of pairs required to make two strings same
- Unbounded Fractional Knapsack
- Check whether a subsequence exists with sum equal to k if arr[i]> 2*arr[i-1]
- Count of integers that divide all the elements of the given array
- Create a Sorted Array Using Binary Search
- Find minimum length sub-array which has given sub-sequence in it
- Count common elements in two arrays containing multiples of N and M
- Maximum distance between two unequal elements
- Maximum String Partition
- Minimum deletions required to make GCD of the array equal to 1
- Minimum operations required to make every element greater than or equal to K
- Minimum number of given operations required to reduce the array to 0 element
- Number of balanced parenthesis substrings
- Find the Kth smallest element in the sorted generated array
- Minimum deletions required such that any number X will occur exactly X times
- Longest Subarray having strictly positive XOR
- Minimizing array sum by applying XOR operation on all elements of the array
- Smallest multiple of N formed using the given set of digits
- Maximize the size of array by deleting exactly k sub-arrays to make array prime
- Maximum possible sub-array sum after at most X swaps
- Count ways to divide circle using N non-intersecting chord | Set-2
- Fractional Knapsack Queries
- Find the minimum of maximum length of a jump required to reach the last island in exactly k jumps
- Find if a binary matrix exists with given row and column sums

Given an array arr[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… Read More »

Given two arrays such that the first array contains multiples of an integer n which are less than or equal to k and similarly, the… Read More »

Given an array Row[] of size R where Row[i] is the sum of elements of the ith row and another array Column[] of size C… Read More »

Given an array, the task is to create a new sorted array in ascending order from the elements of the given array. Examples: Input :… Read More »

Given an array of n-elements find the longest sub-array with the greatest arithmetic mean. The length of the sub-array must be greater than 1 and… Read More »

Given a sorted array of positive integers where arr[i] > 2*arr[i-1], check whether a sub sequence exists whose sum is equal to k. Examples: Input… Read More »

Given two arrays, we have to check whether we can sort two arrays in strictly ascending order by swapping A[i] and B[i]. Examples: Input :… Read More »

Given an array containing distinct positive integers and an integer k. The task is to find the largest possible k-multiple set from the array of… Read More »

Given an integer x. The task is to convert x to the form 2n – 1 by performing the following operations in specified order on… Read More »

Given an array arr[], the task is to find the maximum distance between two unequal elements of the given array. Examples: Input: arr[] = {3,… Read More »

Given a balanced bracket sequence as a string str containing character ‘(‘ or ‘)’, the task is to find the next lexicographical order balanced sequence… Read More »

Given an array arr[] of N integers and an integer X, the task is to find the maximum possible sub-array sum after applying at most… Read More »

A Greedy algorithm is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious… Read More »

Given two strings s1 and s2 of same length, the task is to count the minimum number of pairs of characters (c1, c2) such that… Read More »

Given an array arr[] of N distinct integers, the task is to find the maximum elements in an interval [L, R] such that the interval… Read More »