Coconut Problem

problem link

Someone has submitted a constant time solution but I didn’t get how this is working.

Please help.

Each machine can be referred as adding value-1 number of coconuts.
Hence I think problem is
ax+by+cz+… = Value
Where a,b,c,… Are given array
And x,y,z,… Are integers greater than equal to 0

Can you explain the O(1) approach for this question, I have also given the solution link but not able to understand it.

this solution gives POSSIBLE for default given test case

Yeah, but i don’t know why this is working.

Guess, this is wrong for default case.But default case is not present in original test cases

Can I assume this solution is totally wrong or just missing some edge cases?

Can’t say. I cant understand it too

It seems like he hacked test cases :stuck_out_tongue:
PS: He did ~75 submission.

1 Like

:joy::joy: /////20 char limit