Can anyone help me to figure it out the mistake, it gives wa.
https://pastebin.com/xU1JtE1T
Can anyone help me to figure it out the mistake, it gives wa.
https://pastebin.com/xU1JtE1T
correct link https://pastebin.com/8Z8VMD92
Thanks, it worked in some of the cases…
the approach was to group all the same color weights together and then use classical knapsack. but here I am not sure how to establish 1/1 condition instead of 0/1
pls share ur updated code with me.
https://pastebin.com/SPabLCbK
thanks, it yet failed on the last test case https://pastebin.com/1rQgnZjz
but I eventually tried the editorial method and it worked.
ok … . … . …
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.