6

Longest Common Subsequence

 1 year ago
source link: https://www.geeksforgeeks.org/videos/longest-common-subsequence/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Longest Common Subsequence

August 11, 2023 |470 Views
Longest Common Subsequence
SDE Sheet, GFG SDE Sheet, dynamic-programming
 Save  Share   Like
Description
Discussion

This video is part of the Dynamic Programming section in the GFG SDE Sheet. In this video, we are given two strings. Our task is to find the length of the longest subsequence present in both of them. 

Example :

Input:
A = 6, B = 6
str1 = ABCDGH
str2 = AEDFHR

Output: 3

Explanation: LCS for input strings “ABCDGH” and “AEDFHR” is “ADH” of length 3. 

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/longest-common-subsequence-dp-4/
Problem: https://practice.geeksforgeeks.org/problems/longest-common-subsequence-1587115620/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK