Could you please look at my code only sample input is passing I am not coding where I am getting wrong could you possibly give me some hint how to correct the code.
The link is mention below:
Only Sample Input Test Case Passing
Hey, i think your logic is incorrect.This is a problem of dp with bitmasking and you haven’t used that in your code.
Your code might be giving correct answer on sample test cases due to coincindence.
Please try to do it using dp with bitmasking.
If you don’t know what dp with bitmasking then read about it on codeforces blog/gfg.