Questions related to strings

## Hamming Distance between two strings

You are given two strings of equal length, you have to find the Hamming Distance between these string. Where the Hamming distance between two strings… Read More »

## Implementation of Affine Cipher

The Affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using a… Read More »

## Maximum and minimum sums from two numbers with digit replacements

Given two positive numbers calculate the minimum and maximum possible sums of two numbers. We are allowed to replace digit 5 with digit 6 and… Read More »

## Boggle | Set 2 (Using Trie)

Given a dictionary, a method to do a lookup in the dictionary and a M x N board where every cell has one character. Find… Read More »

## Check whether Strings are k distance apart or not

Given two strings, the task is to find if they are only less than or equal to k edit distance apart. It means that strings… Read More »

## Queries on substring palindrome formation

Given a string S, and two type of queries. Type 1: 1 L x, Indicates update Lth index of string S by x character. Type… Read More »

## Partition a number into two divisible parts

Given a number (as string) and two integers a and b, divide the string in two non-empty parts such that the first part is divisible… Read More »

## Queries on subsequence of string

Given a string S and Q queries, each query contains a string T. The task is print “Yes” if T is subsequence of S, else… Read More »

## Queries for characters in a repeated string

Given a string X. Form a string S by repeating string X multiple times i.e appending string X multiple times with itself. There are Q… Read More »

## Array of Strings in C++ (3 Different Ways to Create)

In C/C++, a string is a 1-D array of characters and an array of string in C is a 2D array of characters. This comes… Read More »

## LCS (Longest Common Subsequence) of three strings

Given 3 strings of all having length < 100,the task is to find the longest common sub-sequence in all three given sequences. Examples: Input :… Read More »

## Efficient method for 2’s complement of a binary string

Given a Binary Number as string, print its 2’s complements. 2’s complement of a binary number is 1 added to the 1’s complement of the… Read More »

## Program to toggle all characters in a string

in a given string in which we toggle all characters. Examples: Input : gfg Output : GFG Input : aBc12# Output : AbC12# Input :… Read More »

## Generate all binary strings without consecutive 1’s

Given a integer K. Task is Print All binary string of size K (Given number). Examples: Input : K = 3 Output : 000 ,… Read More »

## Check length of a string is equal to the number appended at its last

Given a string that (may) be appended with a number at last. You need to find whether the length of string excluding that number is… Read More »