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
Unable to solve for second test case
Hello @lavan.puri99,
I would surely help you if you would share your code with me.
Please, share it using Online Coding Blocks IDE.
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.
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.
Anytime.
Please, mark the doubt as resolved, if you have no more questions regarding this problem.