[python] add distinct subsequences