division by n can leave only n remainder [ 0. . n - 1 ] . dp [ i ] [ j ] indicates number of subsequences in string [ 0. . i ] which leaves remainder j after division by n .
dp = [ [ 0 for x in range ( l ) ] for y in range ( n ) ] NEW_LINE