# Tag Archives: LCS

## Number of ways to insert a character to increase the LCS by one

Given two strings A and B. The task is to count the number of ways to insert a character in string A to increase the… Read More »

## Minimum cost to make Longest Common Subsequence of length k

Given two string X, Y and an integer k. Now the task is to convert string X with minimum cost such that the Longest Common… Read More »

## Print Longest Palindromic Subsequence

Given a sequence, print a longest palindromic subsequence of it. Examples : Input : BBABCBCAB Output : BABCBAB The above output is the longest palindromic… Read More »

## Longest Repeated Subsequence

Given a string, print the longest repeating subseequence such that the two subsequence don’t have same string character at same position, i.e., any i’th character… Read More »

## Longest Common Subsequence with at most k changes allowed

Given two sequence P and Q of numbers. The task is to find Longest Common Subsequence of two sequence if we are allowed to change… Read More »

## Shortest possible combination of two strings

Compute the shortest string for a combination of two given strings such that the new string consist of both the strings as its subsequences. Examples… Read More »

## Shortest Uncommon Subsequence

Given two strings S and T, find length of the shortest subsequence in S which is not a subsequence in T. If no such subsequence… Read More »

## Minimum number of deletions and insertions to transform one string into another

Given two strings ‘str1’ and ‘str2’ of size m and n respectively. The task is to remove/delete and insert minimum number of characters from/in str1… Read More »

## Count ways to increase LCS length of two strings by one

Given two strings of lower alphabet characters, we need to find the number of ways to insert a character in the first string such that… 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 »

## Print all longest common sub-sequences in lexicographical order

You are given two strings.Now you have to print all longest common sub-sequences in lexicographical order? Examples: Input : str1 = “abcabcaa”, str2 = “acbacba”… Read More »

## Longest common subsequence with permutations allowed

Given two strings in lowercase, find the longest string whose permutations are subsequences of given two strings. The output longest string must be sorted. Examples:… Read More »

## Minimum Cost To Make Two Strings Identical

Given two strings X and Y, and two values costX and costY. We need to find minimum cost required to make the given two strings… Read More »

## Find if string is K-Palindrome or not | Set 2

Given a string, find out if the string is K-Palindrome or not. A K-palindrome string transforms into a palindrome on removing at most k characters… Read More »

## Printing Shortest Common Supersequence

Given two strings X and Y, print the shortest string that has both X and Y as subsequences. If multiple shortest supersequence exists, print any… Read More »