title
Using Dynamic Programming to Solve a Real-World Problem! | Build a Startup #5

description
Solving the text difference problem with dynamic programming and JavaScript! Also, here are the links I mentioned in the video: - Our NEW Discord server: https://csdojo.io/d - Source code: https://csdojo.io/text - My old longest common subsequence video: https://youtu.be/Qf5R-uYQRPk - Build a startup series: https://www.youtube.com/playlist?list=PLBZBJbE_rGRXBhJNdKbN7IUy-ctlOFxA1 And, join our Discord, Facebook, and Reddit communities here: https://www.csdojo.io/community/

detail
{'title': 'Using Dynamic Programming to Solve a Real-World Problem! | Build a Startup #5', 'heatmap': [{'end': 668.085, 'start': 628.869, 'weight': 0.855}, {'end': 1421.123, 'start': 1375.55, 'weight': 1}, {'end': 1456.66, 'start': 1426.908, 'weight': 0.879}], 'summary': "Explores the development of the 'edit dojo' language learning app and the use of dynamic programming to enhance language editing efficiency, with a focus on text comparison, longest common subsequence problem, and optimizing lcs function, achieving o(l*m) time complexity for strings of lengths l and m.", 'chapters': [{'end': 45.086, 'segs': [{'end': 45.086, 'src': 'embed', 'start': 0.449, 'weight': 0, 'content': [{'end': 0.91, 'text': 'Hi everyone.', 'start': 0.449, 'duration': 0.461}, {'end': 3.631, 'text': 'So recently, as some of you know,', 'start': 1.45, 'duration': 2.181}, {'end': 10.576, 'text': "I've been working on a project where I try to start a real startup that's based on this app I'm making for learning languages.", 'start': 3.631, 'duration': 6.945}, {'end': 16.58, 'text': 'And in this process, I ran into a problem where I needed to use dynamic programming to solve it.', 'start': 11.376, 'duration': 5.204}, {'end': 19.722, 'text': "So I'm going to show you what the problem was and how I solved it.", 'start': 17.12, 'duration': 2.602}, {'end': 28.29, 'text': "So, like I explained in one of my previous videos, on this app I'm developing which I'm thinking of calling Edit Dojo,", 'start': 20.442, 'duration': 7.848}, {'end': 33.835, 'text': 'people are gonna write stuff in different languages and other people are gonna fix them or edit them for them.', 'start': 28.29, 'duration': 5.545}, {'end': 35.977, 'text': 'So one person might write.', 'start': 34.455, 'duration': 1.522}, {'end': 41.542, 'text': 'the breakfast I had today was awesome and someone else might edit them.', 'start': 35.977, 'duration': 5.565}, {'end': 45.086, 'text': 'edit this to this the breakfast I had today was awesome.', 'start': 41.542, 'duration': 3.544}], 'summary': 'Developing a language learning app, encountered a problem and used dynamic programming to solve it.', 'duration': 44.637, 'max_score': 0.449, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw449.jpg'}], 'start': 0.449, 'title': 'Language learning app and dynamic programming', 'summary': "Discusses the development of 'edit dojo' language learning app and the use of dynamic programming to enhance language editing efficiency and user experience.", 'chapters': [{'end': 45.086, 'start': 0.449, 'title': 'Language learning app and dynamic programming', 'summary': "Discusses the development of the language learning app 'edit dojo' and the use of dynamic programming to solve a problem encountered, aiming to improve language editing efficiency and user experience.", 'duration': 44.637, 'highlights': ["The app 'Edit Dojo' is being developed to allow users to write in different languages and have others edit their content, aiming to enhance language learning and editing efficiency.", "The speaker encountered a problem in the app's development that required the use of dynamic programming for its solution, showcasing the technical challenges faced in creating the language learning platform.", 'The development of the real startup based on the app for learning languages demonstrates the practical application of the language learning platform, indicating a tangible outcome of the project.']}], 'duration': 44.637, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw449.jpg', 'highlights': ['The development of the real startup based on the app for learning languages demonstrates the practical application of the language learning platform, indicating a tangible outcome of the project.', "The app 'Edit Dojo' is being developed to allow users to write in different languages and have others edit their content, aiming to enhance language learning and editing efficiency.", "The speaker encountered a problem in the app's development that required the use of dynamic programming for its solution, showcasing the technical challenges faced in creating the language learning platform."]}, {'end': 479.407, 'segs': [{'end': 88.253, 'src': 'embed', 'start': 45.786, 'weight': 0, 'content': [{'end': 51.652, 'text': 'And the function I was trying to make is the function that shows the difference between these two sentences.', 'start': 45.786, 'duration': 5.866}, {'end': 59.661, 'text': 'So, given these two sentences, we want to be able to say that this word has been deleted from the first sentence and also this word,', 'start': 52.413, 'duration': 7.248}, {'end': 64.285, 'text': 'and then these two words have been sort of added to the second sentence.', 'start': 59.661, 'duration': 4.624}, {'end': 66.887, 'text': 'And there are a few different ways of going about it.', 'start': 65.025, 'duration': 1.862}, {'end': 71.008, 'text': 'One is to compare these two sentences word for word.', 'start': 67.507, 'duration': 3.501}, {'end': 72.148, 'text': "That's what I've done.", 'start': 71.448, 'duration': 0.7}, {'end': 77.23, 'text': "And that's why you see these two words changed.", 'start': 72.708, 'duration': 4.522}, {'end': 82.791, 'text': 'But another way to do this is to compare these two sentences character by character.', 'start': 77.87, 'duration': 4.921}, {'end': 88.253, 'text': 'So if you take that approach, the UI might look like this instead.', 'start': 83.631, 'duration': 4.622}], 'summary': 'Creating a function to compare sentences word by word or character by character and display the differences.', 'duration': 42.467, 'max_score': 45.786, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw45786.jpg'}, {'end': 156.385, 'src': 'embed', 'start': 114.558, 'weight': 1, 'content': [{'end': 121.181, 'text': "But the thing is for languages like Japanese, There's no easy way to split a sentence by words.", 'start': 114.558, 'duration': 6.623}, {'end': 127.025, 'text': 'So I decided to use the comparison by character approach for languages like Japanese.', 'start': 121.881, 'duration': 5.144}, {'end': 133.089, 'text': "And in this video, I'm going to explain the comparison by character approach because it's much simpler to explain.", 'start': 127.846, 'duration': 5.243}, {'end': 141.536, 'text': 'Anyway, whichever approach you decide to take, this problem actually reduces to another problem called the longest common subsequence problem.', 'start': 133.77, 'duration': 7.766}, {'end': 147.479, 'text': 'I already talked about it in one of my really old videos actually, but let me explain what it is here again.', 'start': 142.296, 'duration': 5.183}, {'end': 156.385, 'text': "So in the longest common subsequence problem, you're given two strings, for example these two, abcd and acdb.", 'start': 148.4, 'duration': 7.985}], 'summary': 'Comparison by character used for japanese. longest common subsequence problem explained.', 'duration': 41.827, 'max_score': 114.558, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw114558.jpg'}, {'end': 261.012, 'src': 'embed', 'start': 227.068, 'weight': 3, 'content': [{'end': 230.792, 'text': "So let's say that the original text is this one, I am waiting.", 'start': 227.068, 'duration': 3.724}, {'end': 235.496, 'text': "And let's say that someone else fixed it to this one, I've been waiting.", 'start': 231.493, 'duration': 4.003}, {'end': 252.927, 'text': 'Then what we can do is we can first find the longest common subsequence between these two strings that would be this one i space space waiting and then to find which parts of the first string has been deleted.', 'start': 236.417, 'duration': 16.51}, {'end': 261.012, 'text': 'we can compare this string with the longest common subsequence, this one which is basically the common part of these two strings.', 'start': 252.927, 'duration': 8.085}], 'summary': 'Comparing two strings to find longest common subsequence and deleted parts.', 'duration': 33.944, 'max_score': 227.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw227068.jpg'}, {'end': 357.6, 'src': 'embed', 'start': 326.365, 'weight': 5, 'content': [{'end': 334.108, 'text': 'And one case of this recursive solution is going to be when the given two strings have the same first letter.', 'start': 326.365, 'duration': 7.743}, {'end': 336.069, 'text': 'In this case, A right here.', 'start': 334.688, 'duration': 1.381}, {'end': 346.054, 'text': "And in that case, we'll say whatever the longest common subsequence of these two strings is, it must have A as the first letter.", 'start': 337.009, 'duration': 9.045}, {'end': 357.6, 'text': "So it's sort of like taking off these two letters and then saying the longest common subsequence of these two strings is going to be A,", 'start': 346.794, 'duration': 10.806}], 'summary': 'Recursive solution for finding longest common subsequence of two strings.', 'duration': 31.235, 'max_score': 326.365, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw326365.jpg'}], 'start': 45.786, 'title': 'Text comparison and longest common subsequence', 'summary': 'Discusses methods for comparing sentences by comparing words, with consideration for character comparison in languages like japanese. it also explains the longest common subsequence problem and its application in identifying text changes.', 'chapters': [{'end': 133.089, 'start': 45.786, 'title': 'Text comparison function', 'summary': 'Discusses methods for comparing two sentences to show differences, with a preference for comparing words instead of characters, but considering character comparison for languages like japanese.', 'duration': 87.303, 'highlights': ['The function aims to show the differences between two sentences by indicating deleted and added words, with the option to compare word for word or character by character.', 'Comparing sentences word for word results in easier readability, while the character comparison approach is considered simpler to explain.', 'For languages like Japanese, where splitting sentences by words is challenging, the comparison by character approach is preferred.']}, {'end': 479.407, 'start': 133.77, 'title': 'Longest common subsequence problem', 'summary': 'Explains the longest common subsequence problem where the goal is to find the longest common subsequence between two given strings, and then demonstrates how this problem can be applied to identify the changes made between two versions of a text.', 'duration': 345.637, 'highlights': ["Explained the longest common subsequence problem and demonstrated finding the longest common subsequence between two given strings, with an example of finding the longest common subsequence between 'abcd' and 'acdb'.", "Discussed the application of the longest common subsequence problem to identify changes between two versions of a text, using an example of comparing 'I am waiting' and 'I've been waiting' to find the added and deleted parts.", "Outlined the recursive approach to solving the longest common subsequence problem, covering cases where the given two strings have the same first letter and when they don't have the same letter at the beginning, providing examples and informal explanations for each case."]}], 'duration': 433.621, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw45786.jpg', 'highlights': ['The function aims to show the differences between two sentences by indicating deleted and added words, with the option to compare word for word or character by character.', "Explained the longest common subsequence problem and demonstrated finding the longest common subsequence between two given strings, with an example of finding the longest common subsequence between 'abcd' and 'acdb'.", 'Comparing sentences word for word results in easier readability, while the character comparison approach is considered simpler to explain.', "Discussed the application of the longest common subsequence problem to identify changes between two versions of a text, using an example of comparing 'I am waiting' and 'I've been waiting' to find the added and deleted parts.", 'For languages like Japanese, where splitting sentences by words is challenging, the comparison by character approach is preferred.', "Outlined the recursive approach to solving the longest common subsequence problem, covering cases where the given two strings have the same first letter and when they don't have the same letter at the beginning, providing examples and informal explanations for each case."]}, {'end': 731.596, 'segs': [{'end': 512.818, 'src': 'embed', 'start': 480.433, 'weight': 1, 'content': [{'end': 486.799, 'text': "Now, if you implement this function as is, you'll need to create new strings every time we call this function.", 'start': 480.433, 'duration': 6.366}, {'end': 497.008, 'text': "So, for example, if you're given LCS of these two strings, ABCD and ACDEB, we'll need to create these two strings BCD and CDEB,", 'start': 487.52, 'duration': 9.488}, {'end': 498.47, 'text': 'to call this function recursively.', 'start': 497.008, 'duration': 1.462}, {'end': 501.533, 'text': "And that's pretty wasteful, but we don't have to do that.", 'start': 498.97, 'duration': 2.563}, {'end': 512.818, 'text': "Instead of doing that, we're going to pass in two new arguments That are gonna specify which letters we're currently examining in these two strings.", 'start': 502.033, 'duration': 10.785}], 'summary': 'Optimize function by passing in two new arguments to specify letters being examined.', 'duration': 32.385, 'max_score': 480.433, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw480433.jpg'}, {'end': 554.1, 'src': 'embed', 'start': 523.041, 'weight': 0, 'content': [{'end': 534.304, 'text': "and that's gonna mean we're examining this letter right here, which has the index 0, and this letter right here, whose index is also 0, and And then,", 'start': 523.041, 'duration': 11.263}, {'end': 541.029, 'text': "when we call this function recursively, instead of generating new strings, we're just gonna change the indices.", 'start': 534.304, 'duration': 6.725}, {'end': 554.1, 'text': "So we'll say LCS of ABCD, ACDEB, and then 11, because now we're examining these two letters, B and then C right here, whose index is both one.", 'start': 541.77, 'duration': 12.33}], 'summary': 'Examining and altering letter indices recursively in lcs algorithm.', 'duration': 31.059, 'max_score': 523.041, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw523041.jpg'}, {'end': 599.785, 'src': 'embed', 'start': 572.225, 'weight': 2, 'content': [{'end': 579.938, 'text': "instead of creating these two or these four strings, we're just gonna change the indices again.", 'start': 572.225, 'duration': 7.713}, {'end': 592.242, 'text': 'So this is gonna be like that, max of LCS of the same strings and then two, one, and then LCS of the same strings and one, two.', 'start': 580.698, 'duration': 11.544}, {'end': 596.424, 'text': 'Okay, so let me show you how I would implement this function recursively.', 'start': 592.942, 'duration': 3.482}, {'end': 599.785, 'text': "And I'm gonna show you that using pseudocode.", 'start': 597.244, 'duration': 2.541}], 'summary': 'Implementing a function recursively using pseudocode for string manipulation.', 'duration': 27.56, 'max_score': 572.225, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw572225.jpg'}, {'end': 668.085, 'src': 'heatmap', 'start': 628.869, 'weight': 0.855, 'content': [{'end': 635.613, 'text': "And that's when i1 is equal to s1's length or i2 is equal to s2's length.", 'start': 628.869, 'duration': 6.744}, {'end': 642.757, 'text': "And this is sort of like saying what's the longest common subsequence between an empty string with another string?", 'start': 636.453, 'duration': 6.304}, {'end': 645.538, 'text': 'And the answer is an empty string.', 'start': 643.697, 'duration': 1.841}, {'end': 647.9, 'text': "so we're going to return an empty string from here.", 'start': 645.538, 'duration': 2.362}, {'end': 660.443, 'text': "and the next case that we need to take care of is when the current letters that we're examining s1 square brackets i1 and s2 square brackets i2 are the same.", 'start': 648.96, 'duration': 11.483}, {'end': 668.085, 'text': "if that's the case, we're going to return s1 of the current letter, s1 of i1.", 'start': 660.443, 'duration': 7.642}], 'summary': 'Finding longest common subsequence between two strings and returning an empty string or the current letter.', 'duration': 39.216, 'max_score': 628.869, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw628869.jpg'}], 'start': 480.433, 'title': 'Optimizing lcs function and longest common subsequence algorithm', 'summary': 'Discusses optimizing the lcs function by using two new arguments to specify examined letters, and explaining the implementation of the longest common subsequence algorithm using pseudocode and examining its inefficiency.', 'chapters': [{'end': 523.041, 'start': 480.433, 'title': 'Optimizing lcs function', 'summary': 'Discusses optimizing the lcs function by avoiding the need to create new strings every time the function is called, instead using two new arguments to specify which letters are being examined in the strings.', 'duration': 42.608, 'highlights': ['Instead of creating new strings every time the LCS function is called, the chapter proposes passing in two new arguments to specify the currently examined letters, which reduces wasteful string creation.', "By using two new arguments to specify the examined letters in the strings, the function's efficiency is improved, avoiding the need to recursively create new strings for each function call."]}, {'end': 731.596, 'start': 523.041, 'title': 'Implementing longest common subsequence algorithm', 'summary': 'Explains the implementation of the longest common subsequence algorithm using pseudocode, examining the recursive function and its inefficiency.', 'duration': 208.555, 'highlights': ['The chapter explains the implementation of the Longest Common Subsequence algorithm using pseudocode The chapter covers the implementation of the Longest Common Subsequence algorithm using pseudocode, demonstrating the recursive function and its inefficiency.', "Recursive function's inefficiency The implementation of the recursive function for the Longest Common Subsequence algorithm is noted to be very inefficient."]}], 'duration': 251.163, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw480433.jpg', 'highlights': ["By using two new arguments to specify the examined letters in the strings, the function's efficiency is improved, avoiding the need to recursively create new strings for each function call.", 'Instead of creating new strings every time the LCS function is called, the chapter proposes passing in two new arguments to specify the currently examined letters, which reduces wasteful string creation.', 'The chapter explains the implementation of the Longest Common Subsequence algorithm using pseudocode, demonstrating the recursive function and its inefficiency.', "Recursive function's inefficiency The implementation of the recursive function for the Longest Common Subsequence algorithm is noted to be very inefficient."]}, {'end': 1535.828, 'segs': [{'end': 809.386, 'src': 'embed', 'start': 776.922, 'weight': 0, 'content': [{'end': 785.79, 'text': "and Okay so, this is part of the dynamic programming solution code and it's pretty much exactly the same as what we saw earlier,", 'start': 776.922, 'duration': 8.868}, {'end': 789.353, 'text': 'except for this additional argument that I added here, called memo.', 'start': 785.79, 'duration': 3.563}, {'end': 796.6, 'text': "This is going to be a two-dimensional array that's going to store the return values of this function, LCS.", 'start': 790.234, 'duration': 6.366}, {'end': 809.386, 'text': "And so before we call this function, we're going to have to initialize a new two-dimensional array whose size is going to be s1.length by s2.length.", 'start': 797.521, 'duration': 11.865}], 'summary': 'Dynamic programming solution code with an added memo argument for storing return values of function lcs.', 'duration': 32.464, 'max_score': 776.922, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw776922.jpg'}, {'end': 1016.257, 'src': 'embed', 'start': 964.068, 'weight': 3, 'content': [{'end': 969.532, 'text': 'then the time complexity of this function is going to be this, assuming that my analysis is correct.', 'start': 964.068, 'duration': 5.464}, {'end': 979.958, 'text': "It's going to be O And if you're curious why that's the case, I'd recommend watching my old video about the longest common subsequence.", 'start': 969.992, 'duration': 9.966}, {'end': 987.824, 'text': 'And this is actually much better than the naive recursive solution that we saw earlier, which has an exponential time complexity.', 'start': 980.579, 'duration': 7.245}, {'end': 994.507, 'text': "Okay, so that's the idea of this code, but let me show you if we can actually implement it using JavaScript.", 'start': 988.524, 'duration': 5.983}, {'end': 997.628, 'text': "Okay, so here's the setup I have here.", 'start': 995.267, 'duration': 2.361}, {'end': 1002.811, 'text': 'I have this HTML file, test.html, for showing the test cases.', 'start': 998.409, 'duration': 4.402}, {'end': 1004.852, 'text': 'We have a few test cases here.', 'start': 1003.351, 'duration': 1.501}, {'end': 1006.332, 'text': 'One of them is this one.', 'start': 1005.372, 'duration': 0.96}, {'end': 1011.875, 'text': 'The original text is ABCD, and the edited text is AFKD.', 'start': 1006.892, 'duration': 4.983}, {'end': 1016.257, 'text': 'And the longest common subsequence between these two is AD.', 'start': 1012.575, 'duration': 3.682}], 'summary': 'The time complexity of the function is o, much better than the exponential time complexity of the naive recursive solution.', 'duration': 52.189, 'max_score': 964.068, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw964068.jpg'}, {'end': 1274.553, 'src': 'embed', 'start': 1224.397, 'weight': 5, 'content': [{'end': 1231.343, 'text': 'So the naive recursive solution is efficient enough for the first case, but not efficient enough for the two other cases.', 'start': 1224.397, 'duration': 6.946}, {'end': 1236.026, 'text': "So I'm going to take them out just by changing the code here.", 'start': 1232.263, 'duration': 3.763}, {'end': 1238.308, 'text': "And then I'm going to go back to the browser.", 'start': 1236.046, 'duration': 2.262}, {'end': 1241.831, 'text': 'And when I open the file again, I see the correct results.', 'start': 1239.129, 'duration': 2.702}, {'end': 1247.546, 'text': "Okay, let's now make this code more efficient by using the approach that we saw earlier.", 'start': 1243.345, 'duration': 4.201}, {'end': 1257.289, 'text': 'So the first thing we want to do in this parent function LCS, is we want to initialize a new two-dimensional array called Memo,', 'start': 1248.166, 'duration': 9.123}, {'end': 1261.53, 'text': "whose size is going to be S1's dot length by S2's dot length.", 'start': 1257.289, 'duration': 4.241}, {'end': 1265.371, 'text': 'In JavaScript, there is a neat trick for doing that.', 'start': 1262.51, 'duration': 2.861}, {'end': 1267.052, 'text': 'So let me just write it here.', 'start': 1266.091, 'duration': 0.961}, {'end': 1274.553, 'text': "First, I'm going to write square brackets dot dot dot array s1's length.", 'start': 1268.792, 'duration': 5.761}], 'summary': 'Improved code efficiency by using a two-dimensional array to optimize the parent function lcs.', 'duration': 50.156, 'max_score': 1224.397, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw1224397.jpg'}, {'end': 1421.123, 'src': 'heatmap', 'start': 1375.55, 'weight': 1, 'content': [{'end': 1385.957, 'text': "So result is equal to result a or result b, and then, before we return the result, we're gonna put that in memo of i1, i2,", 'start': 1375.55, 'duration': 10.407}, {'end': 1390.094, 'text': "And then we're going to return that instead.", 'start': 1388.092, 'duration': 2.002}, {'end': 1392.938, 'text': 'So this is going to hopefully work.', 'start': 1390.835, 'duration': 2.103}, {'end': 1396.322, 'text': "Let's see if it works for this particular test case.", 'start': 1393.338, 'duration': 2.984}, {'end': 1397.643, 'text': 'And it does.', 'start': 1397.102, 'duration': 0.541}, {'end': 1403.99, 'text': "Let's fix test.html so that we can test the other cases too.", 'start': 1399.125, 'duration': 4.865}, {'end': 1407.795, 'text': 'Hopefully this is going to be fast enough for the other two cases too.', 'start': 1404.751, 'duration': 3.044}, {'end': 1411.475, 'text': "So let's see if it works here.", 'start': 1410.234, 'duration': 1.241}, {'end': 1413.637, 'text': "And it looks like it's working.", 'start': 1412.196, 'duration': 1.441}, {'end': 1421.123, 'text': 'So in this case, the expected result is I waiting for snow and the actual result is the same.', 'start': 1413.797, 'duration': 7.326}], 'summary': 'Code successfully returns expected result for test cases.', 'duration': 45.573, 'max_score': 1375.55, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw1375550.jpg'}, {'end': 1456.66, 'src': 'embed', 'start': 1426.908, 'weight': 7, 'content': [{'end': 1431.632, 'text': "Okay, so what I'm gonna do now is I'm gonna implement the rest of the algorithm here,", 'start': 1426.908, 'duration': 4.724}, {'end': 1435.655, 'text': 'so that we can actually show the difference between the two given sets of texts.', 'start': 1431.632, 'duration': 4.023}, {'end': 1438.336, 'text': "Okay, so here's what I have now.", 'start': 1436.776, 'duration': 1.56}, {'end': 1447.899, 'text': 'As you can see, we have, for example, in this example we have the original text, the edited text, and we have the LCS.', 'start': 1439.217, 'duration': 8.682}, {'end': 1456.66, 'text': "but we also have this view where we are showing the original text but we're also showing which parts of it have been deleted.", 'start': 1447.899, 'duration': 8.761}], 'summary': 'Implementing algorithm to show difference in given texts.', 'duration': 29.752, 'max_score': 1426.908, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw1426908.jpg'}, {'end': 1456.66, 'src': 'heatmap', 'start': 1426.908, 'weight': 0.879, 'content': [{'end': 1431.632, 'text': "Okay, so what I'm gonna do now is I'm gonna implement the rest of the algorithm here,", 'start': 1426.908, 'duration': 4.724}, {'end': 1435.655, 'text': 'so that we can actually show the difference between the two given sets of texts.', 'start': 1431.632, 'duration': 4.023}, {'end': 1438.336, 'text': "Okay, so here's what I have now.", 'start': 1436.776, 'duration': 1.56}, {'end': 1447.899, 'text': 'As you can see, we have, for example, in this example we have the original text, the edited text, and we have the LCS.', 'start': 1439.217, 'duration': 8.682}, {'end': 1456.66, 'text': "but we also have this view where we are showing the original text but we're also showing which parts of it have been deleted.", 'start': 1447.899, 'duration': 8.761}], 'summary': 'Implementing algorithm to compare text sets, displaying original and edited text with deletions.', 'duration': 29.752, 'max_score': 1426.908, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw1426908.jpg'}], 'start': 732.556, 'title': 'Dynamic programming for lcs problem', 'summary': 'Explores the use of dynamic programming to optimize the computation of the lcs function, achieving a time complexity of o(l*m) for strings of lengths l and m. it also discusses the implementation in javascript and the efficiency improvements achieved.', 'chapters': [{'end': 963.148, 'start': 732.556, 'title': 'Dynamic programming for lcs problem', 'summary': 'Explores the concept of dynamic programming to optimize the computation of the lcs function, proposing the use of a two-dimensional array to store and reuse the return values, ultimately leading to a time complexity of o(l*m) for strings s1 and s2 of lengths l and m respectively.', 'duration': 230.592, 'highlights': ['Dynamic programming optimizes the computation of the LCS function by storing and reusing return values in a two-dimensional array, resulting in a time complexity of O(L*M) for S1 and S2 of lengths L and M. Explains how dynamic programming optimizes the LCS function by reusing return values in a two-dimensional array, leading to a time complexity of O(L*M).', "The addition of the 'memo' two-dimensional array to store return values is a crucial modification in the dynamic programming solution code. Emphasizes the significance of the 'memo' two-dimensional array in storing return values as a key modification in the dynamic programming solution code.", "The function is designed to initialize the 'memo' array and reuse stored return values, improving the efficiency of the LCS computation for repeated arguments. Describes the process of initializing the 'memo' array and reusing stored return values to enhance the efficiency of the LCS computation for repeated arguments."]}, {'end': 1247.546, 'start': 964.068, 'title': 'Implementing longest common subsequence in javascript', 'summary': 'Explains the time complexity of a recursive function to find the longest common subsequence, discusses the implementation in javascript, and highlights the improvement in efficiency by removing inefficient test cases, resulting in correct results.', 'duration': 283.478, 'highlights': ['The time complexity of the recursive function to find the longest common subsequence is O(n*m), where n and m are the lengths of the input strings, which is much better than the naive recursive solution with an exponential time complexity.', 'The implementation of the recursive approach in JavaScript is demonstrated, with the function taking two strings and returning the longest common subsequence between them.', 'The efficiency of the recursive solution is highlighted by the inefficiency in handling longer test cases, leading to the need for improvement by removing inefficient test cases, resulting in correct results.']}, {'end': 1535.828, 'start': 1248.166, 'title': 'Implementing lcs algorithm in javascript', 'summary': 'Explains the implementation of the lcs algorithm in javascript, initializing a two-dimensional array called memo, and demonstrating the comparison of original and edited texts using the lcs to identify added and deleted parts.', 'duration': 287.662, 'highlights': ['The chapter explains the initialization of a two-dimensional array called Memo in JavaScript to store the results of subproblems, enabling efficient retrieval of previously computed values for the LCS algorithm.', 'It demonstrates the practical application of the LCS algorithm by comparing original and edited texts, highlighting the differences and showcasing the implementation.', 'The transcript also mentions the availability of the code for further exploration on csdojo.io/text and invites the audience to join the Discord server and explore the build a startup series on csdojo.io/start.']}], 'duration': 803.272, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/4SP_AY7GGxw/pics/4SP_AY7GGxw732556.jpg', 'highlights': ['Dynamic programming optimizes the computation of the LCS function by reusing return values in a two-dimensional array, leading to a time complexity of O(L*M).', "The addition of the 'memo' two-dimensional array to store return values is a crucial modification in the dynamic programming solution code.", "The function is designed to initialize the 'memo' array and reuse stored return values, improving the efficiency of the LCS computation for repeated arguments.", 'The time complexity of the recursive function to find the longest common subsequence is O(n*m), which is much better than the naive recursive solution with an exponential time complexity.', 'The implementation of the recursive approach in JavaScript is demonstrated, with the function taking two strings and returning the longest common subsequence between them.', 'The efficiency of the recursive solution is highlighted by the inefficiency in handling longer test cases, leading to the need for improvement by removing inefficient test cases, resulting in correct results.', 'The chapter explains the initialization of a two-dimensional array called Memo in JavaScript to store the results of subproblems, enabling efficient retrieval of previously computed values for the LCS algorithm.', 'It demonstrates the practical application of the LCS algorithm by comparing original and edited texts, highlighting the differences and showcasing the implementation.']}], 'highlights': ['Dynamic programming optimizes the computation of the LCS function by reusing return values in a two-dimensional array, leading to a time complexity of O(L*M).', 'The development of the real startup based on the app for learning languages demonstrates the practical application of the language learning platform, indicating a tangible outcome of the project.', "The app 'Edit Dojo' is being developed to allow users to write in different languages and have others edit their content, aiming to enhance language learning and editing efficiency.", "The speaker encountered a problem in the app's development that required the use of dynamic programming for its solution, showcasing the technical challenges faced in creating the language learning platform.", "Explained the longest common subsequence problem and demonstrated finding the longest common subsequence between two given strings, with an example of finding the longest common subsequence between 'abcd' and 'acdb'.", "By using two new arguments to specify the examined letters in the strings, the function's efficiency is improved, avoiding the need to recursively create new strings for each function call.", 'Instead of creating new strings every time the LCS function is called, the chapter proposes passing in two new arguments to specify the currently examined letters, which reduces wasteful string creation.', 'The function aims to show the differences between two sentences by indicating deleted and added words, with the option to compare word for word or character by character.', 'The time complexity of the recursive function to find the longest common subsequence is O(n*m), which is much better than the naive recursive solution with an exponential time complexity.']}