Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int LCS_duzina( char arr1[], char arr2[])
- {
- for( int i=0; i< strlen(arr1); ++i){
- for( int j=0; j< strlen(arr2); ++j){
- if( arr1[i] == arr2[j]){ dp[i][j]= dp[i-1][j-1] + 1; }
- else{ dp[i][j]= max( dp[i][j-1], dp[i-1][j] ); }
- }
- }
- return dp[ strlen(arr1)-1 ] [ strlen(arr2)-1 ];
- }
Add Comment
Please, Sign In to add comment