# Category Archives: Strings

Questions related to strings

## Count of Distinct strings possible by inserting K characters in the original string

Given a string S and an integer K, the task is to find the total number of strings that can be formed by inserting exactly… Read More »

## Minimize length of prefix of string S containing all characters of another string T

Given two string S and T, the task is to find the minimum length prefix from S which consists of all characters of string T.… Read More »

## Minimum number of operations required to obtain a given Binary String

Given a binary strings S of length N, the task is to obtain S from a string, say T, of length N consisting only of… Read More »

## Minimize length of Substrings containing at least one common Character

Given a string str, the task is to find the minimum length of substrings such that all the sub strings of that length from str… Read More »

## Count of binary strings of length N having equal count of 0’s and 1’s and count of 1’s ≥ count of 0’s in each prefix substring

Given an integer N, the task is to find the number of possible binary strings of length N with an equal frequency of 0‘s and… Read More »

## Check if string is right to left diagonal or not

Given string str of perfect square length. The task is to check whether the given string is a right to left diagonal or not. If… Read More »

## Calculate Sum of ratio of special characters to length of substrings of the given string

Given a string str and an array of special characters, specialArray[], the task is to find the sum of the ratio of the count of… Read More »

## Minimize Cost to sort a String in Increasing Order of Frequencies of Characters

Given a string S, the task is to calculate the minimum cost to sort the string in increasing order of their frequencies by swapping a… Read More »

## Check if a Palindromic String can be formed by concatenating Substrings of two given Strings

Given two strings str1 and str2, the task is to check if it is possible to form a Palindromic String by concatenation of two substrings… Read More »

## Arrange the numbers in the Array as per given inequalities

Given a list of N distinct integers and a list of N-1 inequality signs, the task is to insert the integers between the inequality signs,… Read More »

## Check if the given string is linear or not

Given a string str, the task is to check whether the given string is linear or not. If it is linear then print “Yes” else… Read More »

## Check if binary representations of 0 to N are present as substrings in given binary string

Give binary string str and an integer N, the task is to check if the substrings of the string contain all binary representations of non-negative… Read More »

## HTML Entity Parser

Given a string str which has various HTML Entities in it, the task is to replace these entities with their corresponding special character. HTML entity… Read More »

## Minimize cost to replace all the vowels of a given String by a single vowel

Given a string S, the task is to find the minimum cost to convert all the vowels {a, e, i, o, u} in the given… Read More »