Longest common subsequence solution with optimizations
Signed-off-by: Vasanth Raja <ch.vasanth.raja@gmail.com>