Replace LCS algorithm to Hirschberg\'s that runs in linear space