help needed in dp problem boolean parenthesis

Revision en1, by aman_naughty, 2019-07-28 16:23:38

problem : link

code : link

My approach is also the same as mentioned in the editorial but I am getting wrong answer.

Instead of using two separate memoisation table for true and false I am using only one dp

dp[i][j][w] = the number of ways to put parenthesis such that the result is w

where w is 1 for true and 0 for false;

Can someone tell me where am I wrong

Tags #2d-dp, #interview, #help, important

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aman_naughty 2019-07-28 16:23:38 525 Initial revision (published)