distinct subsequence, 2d dp, time O(mn), space(m)