Longest Common Subsequence - Leetcode 1143 - Dynamic Programming (Python)

  Рет қаралды 5,497

Greg Hogg

Greg Hogg

Күн бұрын

Пікірлер
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms For FREE at AlgoMap.io!
@breepoken4218
@breepoken4218 7 ай бұрын
In some ways i find you better than neetcode and other mainstream ones. Underrated and keep uploading!!
@GregHogg
@GregHogg 7 ай бұрын
That's what I like to hear 😊
@ashwanigaur1828
@ashwanigaur1828 6 ай бұрын
Yes agreed..
@thotapraveenvlogs7020
@thotapraveenvlogs7020 5 ай бұрын
Super
@MegaBeastro
@MegaBeastro 14 күн бұрын
great video. I think what helped me visualize the 2d array solution was viewing the empty string as first row and column instead of the first characters of the strings
@jenex5608
@jenex5608 3 ай бұрын
Better than neetcode in my opinion
@siddharthpradeep
@siddharthpradeep 7 ай бұрын
Your Videos really help me learn better. Keep uploading man !
@GregHogg
@GregHogg 7 ай бұрын
Glad to hear it, will do!
@Here.s_how
@Here.s_how 8 күн бұрын
can't we do it using memoization? my code runtime error
@KandadaiSrinivasaManohar
@KandadaiSrinivasaManohar 6 ай бұрын
So which is best , top down or bottom up approach?
@Beeram123
@Beeram123 7 ай бұрын
This is Great video explaination of the Longest Common Subsequence problem!!BTW what are you using whiteboard drawings ?
@GregHogg
@GregHogg 7 ай бұрын
Thank you so much! And it's called Miro :)
@nice-vf4rj
@nice-vf4rj 6 ай бұрын
Hi Greg can you do string compression? Thanks in advance!!
@SemesterAtSeaHopeful
@SemesterAtSeaHopeful 3 ай бұрын
If the recursive solution and the tabulation have the same time complexity, why is the tabulation so much faster?
@Ambatakummmmm
@Ambatakummmmm 2 ай бұрын
iteration is usually a lot faster than recursion
@Redaxi
@Redaxi 2 ай бұрын
Time complexity does not mean runtime, it simply shows how fast runtime gets bigger with respect to the input length
@shun6284
@shun6284 4 ай бұрын
I feel so noob, I can't come up with this solution on my own 😢
@GarouNguyen
@GarouNguyen 6 ай бұрын
bro it top left approach to bottom, why you call this bottom uo
@GregHogg
@GregHogg 6 ай бұрын
Bottom = base cases, top = n (what you desire)
@Martinnnnnn-e5s
@Martinnnnnn-e5s 5 ай бұрын
I tried to do it like Longest Increasing Subsequence. I see string 2 as an indicator of whether I can add the current letter to the subsequence in string 1. However, there might be repetitive letters and it's all too complicated to make it work so I gave up 😂
@SwizzRizzBizz
@SwizzRizzBizz 3 ай бұрын
how are supposed to solve questions like these in an interview in a matter of minutes? These companies are just insane
@GarouNguyen
@GarouNguyen 6 ай бұрын
dp i j = dp i-1 j, dp i j-1 can you explain bro, i still don't unserstand
@Martinnnnnn-e5s
@Martinnnnnn-e5s 5 ай бұрын
if they don't match, you want to go one step backwards, so the current LCS is the same as one step before. Either "i" "j" can go back, so we want the max of them
@adithyar3160
@adithyar3160 6 ай бұрын
you baller...❤
@GregHogg
@GregHogg 6 ай бұрын
🏀
@fantastic-b2m
@fantastic-b2m 6 ай бұрын
am i having some misunderstanding here? the chart that i calculated myself with the same input is 0 0 0 0 0 0 0 0 1 1 1 1 0 1 1 2 2 2 0 1 1 2 2 2 0 1 1 2 2 2 0 1 1 2 3 3 0 1 1 2 3 4
@iancdp9
@iancdp9 3 ай бұрын
That's right, I'm having the same output as you, I believe Greg omitted "a"' from each strings which is why it's still 1 and not 2 in his table.
4Sum - Leetcode 18 - Two Pointers (Python)
4:05
Greg Hogg
Рет қаралды 3,8 М.
70% of Programmers can't solve this LeetCode Easy Question
7:32
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges
5:10:02
Jump Game - Leetcode 55 - Dynamic Programming (Python)
8:42
Greg Hogg
Рет қаралды 7 М.
Longest Common Subsequence (Dynamic Programming)
10:13
CS Dojo
Рет қаралды 140 М.
Climbing Stairs - Leetcode 70 - Dynamic Programming (Python)
10:54
Longest common subsequence algorithm -- example
8:03
Daniel
Рет қаралды 121 М.
8 patterns to solve 80% Leetcode problems
7:30
Sahil & Sarra
Рет қаралды 484 М.
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН