Dynamic programming LCS

Hi.I am new to dynamic programming .I am trying to solve LCS But my solution is not working even on the test case provided and i am not able to figure out mu mistake. plz help me. I didnt memoize it because I wanted to known if it even worked `
#include<bits/stdc++.h>

using namespace std;

#define MOD 1000000007

#define llu long long unsigned

#define lld long long

#define ld long

#define pie 3.141592653589793

char A[15],B[16];
int m,n;
int recursion(int i,int j)
{
if(i>m||j>n)
return 0;

int k=-1;

 for(int z=j;z<n;z++)

 if(A[i]==B[z])

{

k=z;

break;

}

if(k==-1)

return recursion(i+1,j);

else

return max(1+recursion(i+1,k+1),recursion(i+1,j));

}

int main()
{

strcpy(A,“fdjskalajfkdsla”);

strcpy(B,“alsdfkjfjkdsal”);

m=strlen(A);

n=strlen(B);

int z=recursion(0,0);

printf("%d\n",z);

return 0;

}
`

correct answer is 3
reference :

link text

//