Two of my test cases giving TLE, please help to find out the mistake

Code -https://ide.codingblocks.com/s/246389

@7nishit think when for a state (i,j,k) answer is 0, then you always consider it as uncalculated, so initialize DP with -1.


refer this