Http://ide.codingblocks.com/#/s/19084

http://ide.codingblocks.com/#/s/19084
sir… i am getting time limit exceeded in one test case and remaining three test case has been passed and i have used dynamic programming memoization rather than brute force. so plzz… provide me some ideas to come out of it.