I am getting right answer of test cases as well of custom cases but on submission i am getting wrong-answer.
please tell the problem with my code.
Getting wrong-answer
you have used 1D array for storage which is not sufficient . You are only storing the value at the index of wt array which is insufficient as wt is also varying . Use a 2D array for the problem , index vs weight type structure.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.