Bali pairs : solved using dp(top down)


can you please tell me what is wrong in the code;
it runs partially;

@sjduttabbsr2017
Slight changes required
Please see this https://ide.codingblocks.com/s/226191

can you please elaborate on the dp function you used and the 2-d cache matrix .

@sjduttabbsr2017
It is actually very similar to yours buddy
Cache matrix is just like your dp array which is being used to store results
Since there are 2 states for sum%2 dimensions are N*2
Rest the approach is also very similar to yours with topdown DP being used
The only difference is use of 2D dp instead of your 1D DP