LCS code test cases

Cant figure what i am missing 2 test cases aren’t passing, Any hints ?

Hi Rajat, there is a mistake in LCS printing logic!,
try this test and you will know
aaaaaaaaaaaaa
aa

also here is the rectified logic, (SEE IT ONLY AFTER TRYING YOUR BEST).