This video explains a very important programming interview problem which is to find the maximum number of uncrossed lines which can be drawn from one point in list A to another point in list B. The lines can only be drawn if both the point values are same and they do not intersect any other line. A very intuitive way to solve this problem is by using recursion but there will be too manyconfigurations to try because of repeating subproblems. We have the property of repeating subproblems and optimal substructure and hence dynamic programming can be applied to this problem. I have shown why recursion cannot be applied and then using sufficient examples, i have given the intuition for solving this problem using dynamic programming. I have also solved an example to fully clear the concept. In the end, i have also explained the CODE walkthrough. CODE LINK is present below as usual. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
===============================================================================
INSTAGRAM: / surya.pratap.k
LinkedIn: / surya-pratap-kahar-47b...
===============================================================================
CODE LINK: gist.github.co...
Негізгі бет Uncrossed Lines | Dynamic programming | Leetcode
Пікірлер: 161