https://www.geeksforgeeks.org/space-optimized-solution-lcs/