## Lexicographically smallest string after M operations

Given a string S and integer M. The task is to perform exactly M operations to get lexicographical smallest string. In each operation, select one… Read More »

- Median of sliding window in an array
- Minimum number of swaps required to sort an array of first N number
- Efficiently merging two sorted arrays with O(1) extra space and O(NlogN + MlogM)
- Number of pairs in an array with the sum greater than 0
- Maximum number of unique values in the array after performing given operations
- Search an element in a sorted and rotated array with duplicates
- Sort a string according to the frequency of characters
- Find the K closest points to origin using Priority Queue
- Maximum number of overlapping Intervals
- Find lexicographically smallest string in at most one swaps
- Priority queue of pairs in C++ with ordering by first and second element
- Sorting a Map by value in C++ STL
- Count of smaller elements on right side of each element in an Array using Merge sort
- Count number of pairs with positive sum in an array
- Sort an Array which contain 1 to N values in O(N) using Cycle Sort
- Sort the strings based on the numbers of matchsticks required to represent them
- Sorting Algorithm Visualization : Merge Sort
- Minimum increment or decrement required to sort the array | Top-down Approach
- Check if the given string is shuffled substring of another string
- Find the distance between two person after reconstruction of queue
- Longest subarray such that difference of max and min is at-most K
- Sort an Array based on the absolute difference of adjacent elements
- Sort an array of Strings according frequency
- Minimum cost to make an Array a permutation of first N natural numbers
- Maximum Possible Rating of a Coding Contest
- Shortest path in a directed graph by Dijkstra’s algorithm
- When to use each Sorting Algorithm
- Find Non-overlapping intervals among a given set of intervals
- Rank of all elements in a Stream in descending order when they arrive
- Leftmost Column with atleast one 1 in a row-wise sorted binary matrix

Given a string S and integer M. The task is to perform exactly M operations to get lexicographical smallest string. In each operation, select one… Read More »

Given an array arr[] consisting of N integers and an integer K, the task is to find the length of longest subsequence with sum equal… Read More »

Given an integer N denoting number of jobs and a matrix ranges[] consisting of a range [start day, end day] for each job within which… Read More »

Given an array size[] of box sizes, our task is to find the number of boxes left at the end, after putting the smaller sized… Read More »

Given an array A[] of n odd integers and an integer X. Calculate the minimum number of operations required to make the median of the… Read More »

Given an array arr[] of N pairs of integers (A, B) where N is even, the task is to find the minimum sum of choosing… Read More »

Given an array arr[] of positive integers where each element of the array represents the length of the rectangular blocks. The task is to find… Read More »

Given an array arr[] of N positive integers, the task is to count the number of array elements which can be expressed as the product… Read More »

Given N items with weights W[0..n-1], values V[0..n-1] and a knapsack with capacity C, select the items such that: The sum of weights taken into… Read More »

Given an array arr[] of size N and Q queries of the form [L, R], the task is to find the number of distinct values… Read More »

An algorithm like Insertion Sort can be understood easily by visualizing. In this article, a program that visualizes the Insertion Sort Algorithm has been implemented.… Read More »

Given a string consisting of the first N distinct alphabets, the task is to sort the string by using at most N/2 moves. Each move… Read More »

Given an array arr[] of N positive integers. We have to perform one operation on every odd element in the given array i.e., multiply every… Read More »

Given an array arr[] of size N containing integers. The task is to find the length of the longest sub-array having sum equal to the… Read More »

Given an unsorted array arr[] of N integers that are in Arithmetic Progression, the task is to print the missing element from the given series.… Read More »