You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(j == 4)//last column (starting with u) and after is always 1
dp[i][j] = 1;
else
dp[i][j] = dp[i-1][j] + dp[i][j+1];// one less character i.e of length i-1(here we append j in beginning) + all starting with characters after j of length i.