Unable to solve for second test case

can i please get help regarding my code , i guess it is correct but i am unable to clear the second test case , i tried a lot of manual test cases as well

Hello @lavan.puri99,

I would surely help you if you would share your code with me.
Please, share it using Online Coding Blocks IDE.:slightly_smiling_face:

https://ide.codingblocks.com/s/114175 : solution link

@S18ML0016 here is the link : https://ide.codingblocks.com/s/114175

Okay, you have already send it twice.
I am figuring things out and would soon respond to you.

Hello @lavan.puri99,

Here I am with the solution.:wink:
Answer to my question is the answer to your problem:
Why do you think that the following statements are related?

if(ma[i-1][j]==ma[i][j-1]){
if(ma[i-1][j-1]!=ma[i][j]){}
}

Solution:
You intend to check if the two characters at s[i-1] and l[j-1] are equal.
If they are equal and satisfies: if(ma[i-1][j-1]!=ma[i][j])
Then, insert that character.
But in your code, you are equating the numeric values stored at ma[i-1][j] and ma[i][j-1] in the memorization matrix.

Modification:

if(s[i-1]==l[j-1]){
if(ma[i-1][j-1]!=ma[i][j]){}
}

Hope, this would help.
Give a like, if you are satisfied.

1 Like

thanks for the help @S18ML0016.

Anytime.:blush:

Please, mark the doubt as resolved, if you have no more questions regarding this problem.