add numDistinct_byDynamicProgramming