## Find the lexicographically smallest string which satisfies the given condition

Given an array, arr[] of N integers, where arr[i] represents the number of distinct characters in the prefix of length (i + 1) of a… 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
- 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
- Unbounded Fractional Knapsack
- Count of integers that divide all the elements of the given array
- 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 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
- 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
- Count ways to divide circle using N non-intersecting chord | Set-2
- Fractional Knapsack Queries
- Minimum deletions required to make frequency of each letter unique
- Lexicographically smallest string of length N and sum K
- Minimum increment operations to make K elements equal
- Find Nth smallest number that is divisible by 100 exactly K times
- Queries for number of distinct elements from a given index till last index in an array
- Check if string can be rearranged so that every Odd length Substring is Palindrome
- Order of indices which is lexicographically smallest and sum of elements is <= X
- Find optimal weights which can be used to weigh all the weights in the range [1, X]
- Count total number of even sum sequences
- Minimum cost to convert str1 to str2 with the given operations
- Minimum halls required for class scheduling
- Find maximum value of the last element after reducing the array with given operations

Given an array, arr[] of N integers, where arr[i] represents the number of distinct characters in the prefix of length (i + 1) of a… Read More »

Given a number N, the task is to find the sum of digits of a number at even and odd places. Examples: Input: N =… Read More »

You have an unlimited amount of banknotes worth A and B dollars (A not equals to B). You want to pay a total of S dollars using exactly N notes. The… Read More »

Given an integer N containing the digit 4 at least once. The task is to divide the number into two parts x1 and x2 such… Read More »

Given a number N. At every step, subtract the largest perfect square( ≤ N) from N. Repeat this step while N > 0. The task… Read More »

Given a string str, the task is to find the length of the longest sub-string which does not have any pair of consecutive same characters.… Read More »

Given an array arr[] of size N. The task is to find the minimum number of changes required to convert the array such that for… Read More »

Given two unsorted arrays arr1[] and arr2[]. Find the sum of elements from arr1[] whose difference with the mean of arr2[] is < k. Examples:… Read More »

Given three integers N, X and Y. The task is to find N positive integers that satisfy the given equations. a12 + a22 + ….… Read More »

Given two integers N and M. The task is to find the minimum number of steps to reach M from N by performing given operations.… Read More »

Given an integers X. The task is to find the number of jumps to reach a point X in the number line starting from zero.… Read More »

Given an array arr[] of size n where arr[i] is the amount of candies of type i. You have unlimited amount of money. The task… Read More »

Given an array arr[] of n integers and an integer k. The task is to maximize the sum of the array after performing the given… Read More »

Given an undirected unweighted connected graph consisting of n vertices and m edges. The task is to find any spanning tree of this graph such… Read More »

Given a set of N intervals, the task is to find the maximal set of mutually disjoint intervals. Two intervals [i, j] & [k, l]… Read More »