Luv
Luv
  • 160
  • 14 705 280
Longest Common Subsequence: Dynamic Programming | CP Course | EP 99
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html
ALL CP/DSA RESOURCES : linktr.ee/iamluv
FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html
In this video I discuss the Longest Common Subsequence
Practice Questions :
leetcode.com/problems/longest-common-subsequence/
atcoder.jp/contests/dp/tasks
Timestamps:
Explanation : (0:00)
Code : (12:05)
Be a part of our awesome Community. Join
○ Discord : discord.gg/GMH23tq7Y7
○ Telegram : t.me/LuvIsMeYT
○ LinkTree : linktr.ee/iamluv
You can follow me on below platforms for all the latest updates
○ Instagram : i._m_.luv
○ Twitter : Luvk1412
○ Linkedin : www.linkedin.com/in/luvk1412/
Blog(Not frequently updated)
○ Blog : www.codewithluv.in
Hashtags
#longest #common #subsequence #dp #tutorial
zhlédnutí: 44 059

Video

SUBSET SUM & PARTITION PROBLEM : Dynamic Programming | CP Course| EP 98
zhlédnutí 20KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss the how to find if sum is a subset sum in a given array and also Leetcode Partition Equal Subset Problem using dynamic programming with proper explanation along...
ROD CUTTING: Dynamic Programming | CP Course| EP 97
zhlédnutí 21KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss the Rod cutting dynamic programming with proper explanation along with code. It is an example of unbounded knapsack Practice Questions : practice.geeksforgeeks....
Knapsack 2 Atcoder Tutorial With Code: Dynamic Programming | CP Course| EP 96
zhlédnutí 34KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss the Knapsack 2 problem of atcoder with proper explanation along with code Practice Questions : atcoder.jp/contests/dp/tasks Timestamps: Explanation : (0:00) Cod...
0-1 Knapsack Tutorial With Code: Dynamic Programming | CP Course| EP 95
zhlédnutí 22KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss the 0-1 Knapsack problem with proper explanation along with code Practice Questions : atcoder.jp/contests/dp/tasks Timestamps: Explanation : (0:00) Code : (6:16...
Knapsack Concept and Variations: Dynamic Programming | EP 94
zhlédnutí 26KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss the knapsack concept various questions related to it and what is general concept of thinking around them Practice Questions : atcoder.jp/contests/dp/tasks Times...
Coin Change 1 & 2 : Leetcode DP Questions | CP Course | EP 93
zhlédnutí 47KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss longest Coin Change 1 and Coin Change 2 problems of Leetcode in detail along with their explanation and code Practice Questions : leetcode.com/problems/coin-cha...
Longest Increasing Subsequence (LIS) | Dynamic Programming | CP Course | EP 92
zhlédnutí 50KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss longest increasing subsequence problem of dynamic programming and also solve related leetcode question Practice Questions : leetcode.com/problems/longest-increa...
Frog 1 & 2: Atcoder 1D DP Questions | CP Course | EP 91
zhlédnutí 52KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this video I discuss Frog1 and Frog2 questions in Educational DP series of Atcoder along with their proper explanations and code Practice Questions : atcoder.jp/contests/dp/tasks Ti...
Introduction to Dynamic Programming | Tutorial | CP Course | EP 90
zhlédnutí 53KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In video I discuss what is dynamic programming, how I approach its problems, what is bottom up/top down approach, what is memoisation Practice Questions : atcoder.jp/contests/dp/tasks ...
DYNAMIC PROGRAMMING ULTIMATE COURSE OVERVIEW | CP Course | EP 89
zhlédnutí 81KPřed 2 lety
DP Playlist : czcams.com/play/PLauivoElc3gimdmLcIIpafEkzGs4tCQmi.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In video I discuss an overview of my full Upcoming Dynamic Programming Course Timestamps: Introduction: (0:00) Theory to cover : (1:09) Standard Problems: (2:40) Be a part of our aweso...
Google Interview Hard Question | Minimum Spanning Tree | CP Course | EP 88
zhlédnutí 25KPřed 2 lety
Graph/Trees Playlist : czcams.com/play/PLauivoElc3ghxyYSr_sVnDUc_ynPk6iXE.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this i discuss a hard question of the topic Minimum Spanning tree which was also asked to me in Google interview Google Interview Experience : czcams.com/video/CFmdSPZH-i8/...
Kruskal's Algorithm: Minimum Spanning Tree Tutorial | CP Course | EP 87
zhlédnutí 35KPřed 2 lety
Graph/Trees Playlist : czcams.com/play/PLauivoElc3ghxyYSr_sVnDUc_ynPk6iXE.html ALL CP/DSA RESOURCES : linktr.ee/iamluv FREE COMPETITIVE PROGRAMMING COURSE PLAYLIST : czcams.com/play/PLauivoElc3ggagradg8MfOZreCMmXMmJ-.html In this Video I explain Minimum Spanning tree and also discuss one of its algorithm which is Kruskal's Algorithm Practice Questions: cp-algorithms.com/graph/mst_kruskal.html (...
Disjoint Set Union Practice Questions | Code Monk | CP Course | EP 86
zhlédnutí 21KPřed 2 lety
Disjoint Set Union Practice Questions | Code Monk | CP Course | EP 86
Disjoint Set Union (DSU) Tutorial with Code | CP Course | EP 85
zhlédnutí 55KPřed 2 lety
Disjoint Set Union (DSU) Tutorial with Code | CP Course | EP 85
Floyd Warshall Must Solve Question | Medium Hard | CP Course | EP 84
zhlédnutí 21KPřed 2 lety
Floyd Warshall Must Solve Question | Medium Hard | CP Course | EP 84
Floyd Warshall Algorithm: All Pair Shortest Path | Tutorial with Code | CP Course | EP 83
zhlédnutí 44KPřed 2 lety
Floyd Warshall Algorithm: All Pair Shortest Path | Tutorial with Code | CP Course | EP 83
Dijkstra Algorithm: Tutorial with Code & Example Question | CP Course | EP 82
zhlédnutí 66KPřed 2 lety
Dijkstra Algorithm: Tutorial with Code & Example Question | CP Course | EP 82
Multi Source BFS: Tutorial with Code & Example Question | CP Course | EP 81
zhlédnutí 30KPřed 2 lety
Multi Source BFS: Tutorial with Code & Example Question | CP Course | EP 81
0-1 BFS: What is it, How to Code with Example Question | CP Course | EP 80
zhlédnutí 38KPřed 2 lety
0-1 BFS: What is it, How to Code with Example Question | CP Course | EP 80
How to find Shortest Path using BFS | SPOJ NAKANJ | CP Course | EP 79
zhlédnutí 39KPřed 2 lety
How to find Shortest Path using BFS | SPOJ NAKANJ | CP Course | EP 79
Breadth First Search | BFS : The Only Tutorial You need | CP Course | EP 78
zhlédnutí 53KPřed 2 lety
Breadth First Search | BFS : The Only Tutorial You need | CP Course | EP 78
Edge Deletion Questions using DFS | Must Know Concept | CP Course | EP 77
zhlédnutí 31KPřed 2 lety
Edge Deletion Questions using DFS | Must Know Concept | CP Course | EP 77
How to find Lowest Common Ancestor(LCA) in a Tree | CP Course | EP 76
zhlédnutí 30KPřed 2 lety
How to find Lowest Common Ancestor(LCA) in a Tree | CP Course | EP 76
How to find Diameter of a Tree | CP Course | EP 75
zhlédnutí 34KPřed 2 lety
How to find Diameter of a Tree | CP Course | EP 75
Pre-Computation using DFS | Subtree Queries | CP Course | EP 74
zhlédnutí 35KPřed 2 lety
Pre-Computation using DFS | Subtree Queries | CP Course | EP 74
How to DFS in a TREE | Height and Depth of a TREE | CP Course | EP 73
zhlédnutí 48KPřed 2 lety
How to DFS in a TREE | Height and Depth of a TREE | CP Course | EP 73
How To Solve Graph Matrix Problems using DFS | Leetcode Flood Fill | CP Course | EP 72
zhlédnutí 59KPřed 2 lety
How To Solve Graph Matrix Problems using DFS | Leetcode Flood Fill | CP Course | EP 72
How to find Connected Components and Cycle in a Graph using DFS | CP Course | EP 71
zhlédnutí 80KPřed 2 lety
How to find Connected Components and Cycle in a Graph using DFS | CP Course | EP 71
Depth First Search | DFS : The Only Tutorial You need | CP Course | EP 70
zhlédnutí 108KPřed 2 lety
Depth First Search | DFS : The Only Tutorial You need | CP Course | EP 70

Komentáře

  • @sohamjagtap7195
    @sohamjagtap7195 Před 2 hodinami

    Where is he saving the system-build code?

  • @AlokHotta
    @AlokHotta Před 4 hodinami

    best c++ lecture ever been through .

  • @navy_0kr
    @navy_0kr Před 22 hodinami

    Bhaiya, I think it would be helpful if you could pause slightly between your sentences. Sometimes, the continuous flow makes it a bit challenging to absorb everything you're saying.

  • @ANURAGNATH-un6jj
    @ANURAGNATH-un6jj Před dnem

    We can use pair<int, int>

  • @aranchoudhary1477
    @aranchoudhary1477 Před dnem

    💛

  • @vanshajwore7624
    @vanshajwore7624 Před dnem

    great

  • @prakhardeep60
    @prakhardeep60 Před 2 dny

    💛

  • @AnupBarman-bd1ju
    @AnupBarman-bd1ju Před 2 dny

    i think we calculated lowest prime, not highest prime

  • @Naturalbanarasi
    @Naturalbanarasi Před 3 dny

    Sir just for fun there were a 2 luv bhaiyas teaching the time complexity in this video..

  • @JohnPork07
    @JohnPork07 Před 4 dny

    similar problem on Leetcode : Rotting Oranges

  • @rajat_sekhar
    @rajat_sekhar Před 5 dny

    /bin/sh: g++-14: command not found Does anyone have any solution to this problem?

  • @mohammedamaan9476
    @mohammedamaan9476 Před 5 dny

    Your explanation is brilliant

  • @harshgahlot2555
    @harshgahlot2555 Před 6 dny

    Find my solution below class Solution { public: void dfs(int i, int j, int n, int m, vector<vector<int>> &vis, vector<vector<char>> &grid) { //condition checks on the entering node if(i<0 || j<0) return; if(i>=n || j>=m) return; if(grid[i][j]=='0') { vis[i][j]=1; return; } if(vis[i][j]==1) return; //operation on current node vis[i][j]=1; //apply dfs on the child nodes on all four directions ' dfs(i,j+1,n,m,vis,grid); dfs(i,j-1,n,m,vis,grid); dfs(i+1,j,n,m,vis,grid); dfs(i-1,j,n,m,vis,grid); } int numIslands(vector<vector<char>>& grid) { //cout<<'working'<<endl; int noIslands = 0; int n= grid.size(); int m= grid[0].size(); vector<vector<int>> vis(n, vector<int>(m, 0)); for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if( grid[i][j]!='0' && vis[i][j]!=1){ dfs(i,j,n,m,vis,grid); noIslands++; } } } return noIslands; } };

  • @vivekshah3170
    @vivekshah3170 Před 6 dny

    those who getting wrong answers try this one: #include<numeric> using namespace std; const int Mod=1e9+7; void dfs(int v,vector<int>g[],vector<bool>&vis,vector<int>&subtree_sum,vector<int>&val) { subtree_sum[v]+=val[v-1]; vis[v]=true; for(auto c:g[v]) { if(vis[c]) { continue; } dfs(c,g,vis,subtree_sum,val); subtree_sum[v]+=subtree_sum[c]; } } int Solution::deleteEdge(vector<int> &A, vector<vector<int> > &B) { int n=A.size(); vector<int>g[n+1],subtree_sum(n+1,0); vector<bool>vis(n+1,false); for(auto e:B) { g[e[0]].push_back(e[1]); g[e[1]].push_back(e[0]); } dfs(1,g,vis,subtree_sum,A); long long ans=0; for(int i=2; i<=n; i++) { int x=(subtree_sum[i]); int y=(subtree_sum[1]-x); ans=max(ans,(x*1LL*y)); } return ans%Mod; }

  • @MahendraNagpure99
    @MahendraNagpure99 Před 6 dny

    Code with Harry light pro max😅

  • @tanishqaswar8859
    @tanishqaswar8859 Před 6 dny

    2 - 3 ghante soch ne laga fir samga

  • @rohitnandagawali1589

    💛💛

  • @heyyounotyouyou3761

    We can do this in O(n), without using stacks too. Just loop from the right and have a variable storing the max number

  • @rohithkumar7894
    @rohithkumar7894 Před 7 dny

    💚💚💚💚

  • @Abhishek-sz8wg
    @Abhishek-sz8wg Před 7 dny

    thank u cp master 🪔

  • @almamunsiddiki7697
    @almamunsiddiki7697 Před 7 dny

    For the second question: 1. find the number (lim) greater than C with all bits set. 2. a) iterate through lim to 1, Let each number as A; b) in each iteration find B . wich is equal to A^C. c) find maximum product. Code for clear understanding: #include<bits/stdc++.h> using namespace std; int main(){ int c, a, b; long long ans = 1; cin >> c; int bits = 0, n; n = c; while(n > 0){ bits++; n >>= 1; } int lim = pow(2, bits) - 1; for(int i = lim; i > 0; --i){ b = c ^ i; ans = max(ans , b * 1LL * i); } cout << ans; return 0; }

  • @prakhardeep60
    @prakhardeep60 Před 7 dny

    💛

  • @prakhardeep60
    @prakhardeep60 Před 7 dny

    💛

  • @GamingJerry
    @GamingJerry Před 8 dny

    💛

  • @azzu1739
    @azzu1739 Před 9 dny

    bhai thida level kam karke padhalee,samaj me aane ke liye 2 baar dekhna padta hai

  • @sakshamvijaygarvitvijay6082

    💚💚

  • @vinit9598
    @vinit9598 Před 9 dny

    best video on recursion

  • @mangeshtrimbake3170

    have you covered sliding window in ur series?

  • @prateekparashar17
    @prateekparashar17 Před 9 dny

    pdf kaha milengi eski

  • @mangeshtrimbake3170

    In this playlist , any sliding window concept video ???

  • @Mozammil-Ali
    @Mozammil-Ali Před 9 dny

    Sir mai c++ start kya hu , ye saficient rhega for cp?

  • @tasnimul0096
    @tasnimul0096 Před 10 dny

    iam just at ep 22 and i already have lost 55 braincells :"), still holding upppp

  • @AKASHKUMAR-li7li
    @AKASHKUMAR-li7li Před 10 dny

    very clear and crisp explanation...♥♥

  • @muhafijnaikawadi4959
    @muhafijnaikawadi4959 Před 10 dny

    Thank you so much!😉😉

  • @jayroy855
    @jayroy855 Před 11 dny

    Can you told me how you create "model-bw_dru.h5" , model-bw_smn.h5 and "model-bw_tkdl.h5" models..... If any source code is available???...

  • @user-vc9vv7fe4r
    @user-vc9vv7fe4r Před 11 dny

    💛💛💛

  • @ANURAGNATH-un6jj
    @ANURAGNATH-un6jj Před 11 dny

    💛💛💛💛

  • @fightforfitness2256
    @fightforfitness2256 Před 11 dny

    🔥🔥bhaiya. Kya mast samjhaya hai, ek no.

  • @varunkapoor662
    @varunkapoor662 Před 12 dny

    why you didnt used pow in gpl question what is the problem with that as I have used it and also my submission is partially correct #include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ long int s; cin>>s; string p; cin>>p; long long int code=0; for(long int i= s-1;i>=0;--i){ long int n=0,o=0; o=s-i-1; n=p[i]-'0'; code += n*pow(2,o); } cout<<code<<endl; } }

  • @User-yb3yc
    @User-yb3yc Před 12 dny

    Bhai kaha ho ab ? 😢

  • @hamedhasan5843
    @hamedhasan5843 Před 13 dny

    Thanks for this ❤

  • @PoojaSharma-nt3ge
    @PoojaSharma-nt3ge Před 13 dny

    The selection of the similar problems to explain the difference is very well thought!

  • @PoojaSharma-nt3ge
    @PoojaSharma-nt3ge Před 13 dny

    The important difference nobody tells you! 🙌🏻🙌🏻🙌🏻 very well explained

  • @KeshavKumar-jl1ub
    @KeshavKumar-jl1ub Před 13 dny

    superb... explanation... thnkss..

  • @UsamaBinMahbub-f8r
    @UsamaBinMahbub-f8r Před 13 dny

    Thanks bro, and @YouKnowWho

  • @sc0rpion997
    @sc0rpion997 Před 13 dny

    🤍

  • @prakhardeep60
    @prakhardeep60 Před 14 dny

    💛

  • @aryankumardwivedi2654

    #include <bits/stdc++.h> using namespace std; const int N = 1e7 + 10; int hsh[N][26]; int main() { int t; cin >> t; while (t--) { for (int i = 0; i < N; i++) { for (int j = 0; j < 26; j++) { hsh[i][j] = 0; } } int n, q; cin >> n >> q; string s; cin >> s; for (int i = 0; i <n; i++) { hsh[i+1][s[i] - 'a']++; } for (int i = 0; i < 26; i++) { for (int j = 1; j <= n; j++) { hsh[j][i] += hsh[j - 1][i]; } } while (q--) { int l, r; cin >> l >> r; int oddcnt = 0; for (int i = 0; i < 26; i++) { int charCt = hsh[r][i] - hsh[l - 1][i]; if (charCt % 2 != 0) { oddcnt++; } } if (oddcnt > 1) { cout << "NO" << endl; } else { cout << "YES" << endl; } } } }

  • @muhammadjobayer5206
    @muhammadjobayer5206 Před 14 dny

    💞💛💛💛💛💛💛💛💛💛💛💛💛💛