I would say it's an easy programming solution (just math) and a medium - hard math problem. Although if we wanted to avoid the easy programming solution and utilize some more programming I would put it at medium with the DP approach.
You touched on this, but I would also like to see the problem specifically state that any given bucket can be sampled an infinite number of times (by an unlimited number of pigs). At first, I was thinking that only one sample can be taken from a given bucket (and after that point, it was considered "consumed"). Found out I was wrong after running my code.
@lano1 At time t = 1, why Pig_0 is again trying bucket 1 as Pig_1 has already tried it at t = 0?
You're completely correct.
Quite honestly, because I felt it removed unnecessary decisions when explaining the problem and makes the pattern more easy to see. We're not trying to optimise for "number of drinks", only for "number of pigs used".
As an aside, the example is used to explain why the maths works. The computer would not need to perform any of the time steps listed
@czhangaegean It is the latter case since the problem states that the pig dies within 15 minutes.
And this is actually a very critical condition to impact how you can design the feeding solution. With only the time window, it means you don't want to feed a pig multiple times within 15 minutes, because the worst scenario is that the pig dies and no way to tell which bucket causes the death.