# Remove alternate duplicate characters in a sentence in-place.

Given a string of characters, we aim to remove all its alternate duplicate characters in that string in-place. Let us see this with an example. We can solve this using an additional integer array of constant size of 127. Algorithm steps are as follows. For every character in the string, we insert ‘1’ in itsRead More »

# Longest palindromic substring length of a given string (recursion and dynamic programming approach)

A substring is a string formed based on a continuous subset of characters of another big series. Let’s see the following example. As we do in the longest palindromic subsequence length, we have a similar formula here with a small condition. The condition here is the length of substring whichever formed should be equal toRead More »

# Coin change problem (Find all number of combinations that formed a sum amount with given denominations)

Given a set of denominations of coins and an amount, our aim is find number of combinations in which we can arrange denominations to form our input amount. Let’s understand this better with following example. We can solve this problem using below two different approaches. Recursion Dynamic Programming. Recursion Let’s divide our problem into smallerRead More »

# Find the median of an unsorted stream of integers at any given time

An unsorted integer stream is coming, we need to always keep the median of all the stream elements. The median can be defined as follows. To find the median of any given array, Sort the array Find integer(s) in the middle of the sorted array The average of middle these integers is median ( IfRead More »