Skip to content

Commit

Permalink
Update Longest Common Subsequence.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniverma authored Oct 1, 2021
1 parent 98a038d commit 55bf422
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions C++/Algorithms/Dyanmic Programming/Longest Common Subsequence.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@


/*Given two sequences, find the length of longest subsequence present in both of them. Both the strings are of uppercase.*/
/*Given two sequences, find the length of longest subsequence present in both of them. Both the strings are of uppercase.
Sample Input:
6 7
AGGTAB
GXTXAYB
Output:
The length of Longest Common Subsequence is 3
*/

#include<bits/stdc++.h>
using namespace std;
Expand Down Expand Up @@ -30,6 +42,6 @@ int main(){
cin>>s1>>s2;
int ans=0;
ans=lcs(n,m,s1,s2);
cout<<"Longest Common Subsequence "<<ans<<"\n";
cout<<"The length of Longest Common Subsequence is "<<ans<<"\n";

}
}

0 comments on commit 55bf422

Please sign in to comment.