We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Common Child
- Discussions
Common Child
Common Child
Sort by
recency
|
669 Discussions
|
Please Login in order to post a comment
Python Solution:
python:
My solution based on https://www.geeksforgeeks.org/longest-common-subsequence-dp-4/:
include
using namespace std;
int test(string s1, string s2) { int n1 = s1.length(); int n2 = s2.length(); vector> dp(n1 + 1, vector(n2 + 1, 0));
}
int main() { string s1, s2; cin >> s1 >> s2; cout << test(s1, s2) << endl; return 0; }
C language solution using dynamic programming (recursion with memory)