# Find the longest substring with given max unique characters.

Given a string and an integer representing max unique characters, we aim to find the longest substring that does not exceed max unique characters. Let us understand this with an example. We can solve this problem by iterating over each character set in the array and gets the difference in character change. Let’s see thisRead More »

# Parentheses matching problem.

Given a set of parentheses (a string expression), we aim to validate those parentheses. Let us see this with some examples. We can solve this problem using stack data structure. Here we have taken three sets of braces which are ‘{}’, ‘()’ and ‘[]’. Algorithm Check if stack not empty and current bracket character isRead More »

# Remove duplicate characters from a string in-place.

Given a string of length ‘N’ (characters), we aim to remove all the characters which are duplicates in the input string. Let us understand this with the following example. To solve this kind of problem, we follow the same approach as we observed in removing alternate characters in a string in-place. The steps are asRead More »

# Eliminate Duplicate Characters in a Sentence Quickly and Easily!

Given a string of characters, we aim to remove all its alternate duplicate characters in that string in-place. Let’s look at an example to demonstrate how we can quickly and easily remove all alternating duplicate characters from a string of characters. We can solve this issue by creating an integer array of constant size 127.Read More »

# Check if two string are anagrams to one another.

Every character in a string exists in another, and the characters in second-string also exist in the first string, then both strings are anagrams. Let us see this with an example. To solve this problem, We take an array of size 26 (to handle 26 alphabets) as showing in below picture. Once we have theRead More »