[python] add longest common subsequence
[cpp] add prefix expressions