X = " 0121301 " and Y = "132010"
Coming from the end of each string, last character are not matched,
So just ignore the last character in X or in Y.
LCS( X,Y) = MAX( $\color{red}{LCS("0121301", "13201")}, \;\; \color{green}{LCS( "012130","132010")}\;\; )$
$\color{red}{LCS("0121301", "13201")}$ = LCS("01213", "132") + "01"
LCS("01213", "132") = "13" or "12"
===> LCS("0121301", "13201") = "1301" or "1201"
$\color{green}{LCS( "012130","132010")}$ = LCS( "01213","13201") + "0"
LCS( "01213","13201") = MAX( $\color{blue}{LCS("0121", "13201")}, \;\; \color{violet}{LCS( "01213","1320")}\;\; )$
$\color{blue}{LCS("0121", "13201")}$ = "121"
$ \color{violet}{LCS( "01213","1320")}$ = "12" or "13"
===> LCS( "01213","13201") = "121" ===> $\color{green}{LCS( "012130","132010")}$ = "1210"
∴ Length of LCS = 4
similar one https://gateoverflow.in/230069/made-easy-test-series