Where am I going wrong with my LCS code?

problem link: https://atcoder.jp/contests/dp/tasks/dp_f

my code : https://atcoder.jp/contests/dp/submissions/8592199

1 Like

Your code giving wa for this input
azbz
zabz
your answer=az
correct answer=zbz

2 Likes