Print Longest Common Subsequence | DP On Strings | DP Concepts & Qns-19

Subscribers:
92,300
Published on ● Video Link: https://www.youtube.com/watch?v=cVIOzjfxdbU



Duration: 33:06
499 views
26


iPad PDF Notes - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/DP%20Concepts%20%26%20Qns%20-%20Print%20LCS%20-%20Video%20-%2019.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A

This is the 19th Video of our Playlist "DP Concepts & Qns".
From this video we have started "DP On Strings" and this is the first video of "DP On Strings" series in this playlist.
In this video we will try to solve a very good and famous DP problem : Print Longest Common Subsequence

Longest Common Subsequence - https://youtu.be/aJNu_DLyOxY?si=hENg3QjReCLLtbgA

I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.
Also, please note that my Github solution link below contains both C++ as well as JAVA code.

Problem Name : Print Longest Common Subsequence | DP On Strings | DP Concepts & Qns-19
Company Tags : Amazon Online Assessment
My solutions on Github(C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/DP/DP%20on%20Strings/Printing%20Longest%20Common%20Subsequence.cpp
Leetcode Link : https://www.geeksforgeeks.org/printing-longest-common-subsequence/ (You can print and check your LCS in this leetcode problem)


My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls
My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w
My Recursion Concepts Playlist : https://www.youtube.com/watch?v=pfb1Zduesi8&list=PLpIkg8OmuX-IBcXsfITH5ql0Lqci1MYPM
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
Subscribe to my channel : https://www.youtube.com/@codestorywithMIK

Approach Summary :
The provided code has printLongestCommonSubsequence function that takes two strings, s1 and s2, as input. The method uses dynamic programming to find and print the Longest Common Subsequence (LCS) of the given strings. It initializes a 2D vector t to store the length of LCS for each pair of substrings. It then populates the vector using a bottom-up approach and retrieves the LCS by backtracking through the filled matrix. Finally, the LCS is printed to the console. The code utilizes the standard library's vector and string classes.

╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

✨ Timelines✨
00:00 - Introduction
00:10 - Motivation
00:29 - What have we done till now ?
00:55 - List of Problems - DP on Strings
02:32 - Recalling LCS
15:26 - Finding LCS String
24:14 - Story To Code
28:15 - Coding it up
32:27 - Time & Space Complexity

#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #newyear2024




Other Videos By codestorywithMIK


2024-03-07Happy International Women’s Day, 2024 #womensday #codestorywithmik
2024-03-06Spend your time wisely #codestorywithMIK #motivation #hardwork
2024-03-04Minimum Length of String After Deleting Similar Ends | Simple Two Pointers | Leetcode 1750
2024-03-04Stay tuned - Life Changing Moment
2024-03-04Largest Number formed from an Array | Largest Number | Comparators Application | Leetcode 179
2024-03-02Remove Nth Node From End of List | 1 Pass | 2 Pass | Leetcode 19
2024-03-01Just don't give up. #codestorywithmik
2024-03-01Squares of a Sorted Array | 2 Approaches | Follow Up | Leetcode 977
2024-02-29Maximum Odd Binary Number | 2 Approaches | Leetcode 2864
2024-02-29Comparators in C++ | sort Example | Function Pointer | Functors | Lambda Expressions
2024-02-29Print Longest Common Subsequence | DP On Strings | DP Concepts & Qns-19
2024-02-28Keep moving guys. We are together 💪
2024-02-28Even Odd Tree | DFS | BFS | Leetcode 1609
2024-02-28Permutations II | Two Approaches | Detailed | Recursion Concepts And Questions
2024-02-27Find Bottom Left Tree Value | 3 Approaches | Simple Story | Microsoft | Leetcode 513
2024-02-27Power Set | Same as Subsets | Magic Of Recursion | Recursion Concepts And Questions
2024-02-26Diameter of Binary Tree | Simple Story | Amazon | Leetcode 543
2024-02-26Earliest Second to Mark Indices I | Detailed Intuition | Leetcode Weekly Contest 386 | Leetcode 3048
2024-02-25Generate Parentheses | 2 Approaches | Magic Of Recursion | Recursion Concepts And Questions
2024-02-25Greatest Common Divisor Traversal | Why Graph | Why DSU | Google | Leetcode 2709
2024-02-24Find All People With Secret | 4 Approaches | Google | Leetcode 2092