Questions related to strings

## Minimum cost to traverse from one index to another in the String

Given a string S of length N consisting of lower case character, the task is to find the minimum cost to reach from index i… Read More »

## Minimum swaps required to make a binary string divisible by 2^k

Given a binary string S of length N and an integer K, the task is to find the minimum number of adjacent swaps required to… Read More »

## Number of ways to convert a character X to a string Y

Given a character X and a string Y of length N and the task is to find the number of ways to convert X to… Read More »

## Contiguous subsegments of a string having distinct subsequent characters

Given a string str of length L and an integer N, the task is to form a total of (L / N) contiguous subsegments of… Read More »

## Remove vowels from a string stored in a Binary Tree

Given a binary tree in such a way such that the level order traversal of a binary tree produces a string S. The task is… Read More »

## Print the frequency of each character in Alphabetical order

Given a string str, the task is to print the frequency of each of the characters of str in alphabetical order. Example: Input: str =… Read More »

## Program to print a doormat pattern having a string written in the center in Python

Given the number of rows R and the number of columns C, the task is to print a doormat pattern as shown in the examples… Read More »

## Find the number obtained after concatenation of binary representation of M and N

Given two integers M and N the task is to find the number formed by concatenating the binary equivalents of M and N i.e. M… Read More »

## Number of sub-strings in a given binary string divisible by 2

Given a binary string str of length N, the task is to find the count of substrings of str which are divisible by 2. Leading… Read More »

## Smallest non-zero substring which has any permutation divisible by 2^K

Given a binary string S of length N and an integer K, the task is to find the smallest non-zero sub-string of S that can… Read More »

## Longest substring with K unique characters using Binary Search

Given a string str and an integer K, the task is to print the length of the longest possible substring that has exactly K unique… Read More »

## XOR two binary strings of unequal lengths

Given two binary string of unequal lengths A and B, the task is to print the binary string which is the XOR of A and… Read More »

## Largest sub-string of a binary string divisible by 2

Given a binary string str of length N, the task is to find the longest sub-string divisible by 2. If no such sub-string exists then… Read More »

## Number of subsequences in a given binary string divisible by 2

Given a binary string str of length N, the task is to find the count of subsequences of str which are divisible by 2. Leading… Read More »

## Find whether X exists in Y after jumbling X

Given two strings X and Y containing lower-case alphabets, the task is to check whether any permutation of string X exists in Y as its… Read More »