getting tle: your name is mine

i tried to optimize my code but it still gives tle

can anyone please help.

my code:


Your code is giving WA bacause of this part:

{  for(;j<=k;j++)
   {   if(b[m]==a[j])
       {  c++;break;}

See this

You approach is giving TLE as you are using strlen() function in the for loop as breaking condition.
If you will use


then your code will not give TLE. strlen() takes O(n) time to calculate the length of the string. So using strlen() made your code O(n^2).