/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/common-child * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include #include #include #include #include using namespace std; // Longest Common String Problem. int dp[5001][5001]; int main() { char str1[5002],str2[5002]; scanf("%s %s",str1,str2); int n=strlen(str1),m=strlen(str2); for (int i=0;i