MAXAND18: Partially Accepted

here is my solution for problem (
Can anyone please find where my code breaks

You can refer to my solution here
I think you should set the value mp[ind] to something like -1 so that it will never be picked up. Setting it to 0 will cause bugs when the value of k is larger than the MSB of the largest number in the array.

1 Like


Thank you @galencolin!!