06 - Longest Common Subsequence - Recursive approach
@Rishi Srivastava
Break down the problem into subproblems using recursive approach.
Pseudo code:
If last characters of both sequences match (or text1[row-1] == text2[col-1]) then
LCS(text1[], text2[]) = 1 LCS(text1[], text2[])
If last characters of both sequences do not match (or text1[row-1] != text2[col-1]) then
LCS(text1[], text2[]) = MAX[text1(LCS(text1[], text2[]), LCS(text1[], text2[]))]
Github:
Leetcode:
1 view
1830
643
1 day ago 00:11:17 1
Геоинженерия: как выключат потепление в Антарктике..
1 day ago 01:11:55 1
Основы экономики: как начать понимать
2 days ago 01:12:11 2
🟦 Forza Horizon 5 🍺 ИГРЫ ФЕСТИВАЛЯ! Полное Прохождение ЗИМНЕГО Сезона!!!
3 days ago 00:10:20 2
Women’s Jump Events Qualifications in SLOW MOTION | European Athletics Championships ROMA 2024