Tutorials
Courses
Go Premium
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.0K+ articles
Misc
7.8K+ articles
Arrays
4.2K+ articles
Strings
2.1K+ articles
Dynamic Programming
1.1K+ articles
Searching
1.0K+ articles
Recursion
590+ articles
subsequence
434+ articles
LIS
61+ articles
LCS
45 posts
Recent Articles
Popular Articles
DP Standard Problem Variations
Last Updated: 23 July 2025
When we solve Dynamic Programming problems, we try to find a pattern by matching pattern with a standard DP problem. This is generally recommended to solve new DP problems...
read more
Dynamic Programming
DSA
Fibonacci
LIS
LCS
catalan
binomial coefficient
POTD Solutions | 13 Nov’ 23 | Shortest Common Supersequence
Last Updated: 23 July 2025
View all POTD SolutionsWelcome to the daily solutions of ourPROBLEM OF THE DAY (POTD). We will discuss the entire problem step-by-step and work towards developing an optim...
read more
Strings
Dynamic Programming
DSA
LCS
Algorithms-Dynamic Programming
GFG-POTD-Solutions
Length of Longest Common Subsequence with given sum K
Last Updated: 23 July 2025
Given two arrays a[] and b[] and an integer K, the task is to find the length of the longest common subsequence such that sum of elements is equal to K.Examples:Input: a[]...
read more
Dynamic Programming
Recursion
DSA
Arrays
subsequence
LCS
Memoization
Longest Common Subsequence with no repeating character
Last Updated: 23 July 2025
Given two strings s1 and s2, the task is to find the length of the longest common subsequence with no repeating character.Examples:Input: s1= "aabbcc", s2= "aabc"Output: 3...
read more
Strings
Recursion
DSA
LCS
Minimize partitions in given string to get another string
Last Updated: 23 July 2025
Given two strings A and B, print the minimum number of slices required in A to get another string B. In case, if it is not possible to get B from A, then print "-1".Exampl...
read more
Strings
Algo Geek
Algo-Geek 2021
DSA
LCS
Find the Longest Common Subsequence (LCS) in given K permutations
Last Updated: 23 July 2025
Given K permutations of numbers from 1 to N in a 2D array arr[][]. The task is to find the longest common subsequence of these K permutations.Examples:Input: N = 4, K = 3a...
read more
Misc
Pattern Searching
Mathematical
Combinatorial
Matrix
DSA
Arrays
permutation
LCS
Maximize given function by selecting equal length substrings from given Binary Strings
Last Updated: 23 July 2025
Given two binary strings s1 and s2. The task is to choose substring from s1 and s2 say sub1 and sub2 of equal length such that it maximizes the function:fun(s1, s2) = len(...
read more
Strings
Greedy
DSA
binary-string
LCS
Minimize operations to delete all elements of permutation A by removing a subsequence having order as array B
Last Updated: 23 July 2025
Given two permutation arrays A[] and B[] of the first N Natural Numbers, the task is to find the minimum number of operations required to remove all array elements A[] suc...
read more
Misc
Mathematical
DSA
Arrays
permutation
LCS
Natural Numbers
Maximize [length(X)/2^(XOR(X, Y))] by choosing substrings X and Y from string A and B respectively
Last Updated: 26 July 2025
Given two binary strings A and B of size N and M respectively, the task is to maximize the value of the length of (X) / 2XOR(X, Y) by choosing two substrings X and Y of eq...
read more
Dynamic Programming
Experienced
DSA
Arrays
LCS
Experiences
Longest Common Subsequence (LCS) by repeatedly swapping characters of a string with characters of another string
Last Updated: 23 July 2025
Given two strings A and B of lengths N and M respectively, the task is to find the length of the longest common subsequence that can be two strings if any character from s...
read more
Misc
Strings
Hash
DSA
subsequence
LCS
frequency-counting
Longest Common Subsequence of two arrays out of which one array consists of distinct elements only
Last Updated: 23 July 2025
Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays.Examples:Input: firstArr[]...
read more
Technical Scripter 2020
DSA
Binary Search
subsequence
LIS
LCS
cpp-map
Minimum cost required to rearrange a given array to make it equal to another given array
Last Updated: 23 July 2025
Given two arrays A[] and B[] consisting of M and N integers respectively, and an integer C, the task is to find the minimum cost required to make the sequence A exactly th...
read more
Dynamic Programming
DSA
Arrays
subsequence
LIS
LCS
array-rearrange
Minimize elements to be added to a given array such that it contains another given array as its subsequence | Set 2
Last Updated: 15 July 2025
Given an array A[] consisting of N distinct integers and another array B[] consisting of M integers, the task is to find the minimum number of elements to be added to the ...
read more
Dynamic Programming
Searching
Mathematical
DSA
Arrays
Google
Binary Search
interview-preparation
LIS
LCS
Minimize elements to be added to a given array such that it contains another given array as its subsequence
Last Updated: 15 July 2025
Given an array A[] consisting of N distinct integers and another array B[] consisting of M integers, the task is to find the minimum number of elements to be added to the ...
read more
Dynamic Programming
Searching
DSA
Arrays
subsequence
LCS
array-rearrange
Length of longest common prime subsequence from two given arrays
Last Updated: 15 July 2025
Given two arrays arr1[] and arr2[] of length N and M respectively, the task is to find the length of the longest common prime subsequence that can be obtained from the two...
read more
Dynamic Programming
Searching
Recursion
DSA
subsequence
LCS
Prime Number
1
2
3
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !