Unless there’s a constraint I’m misunderstanding, the test are logically wrong.
In Two Bucket the problem to solve is to find the number of steps needed to get a bucket to a certain amount; by filling, by emptying, and pouring from one bucket to other. The first step is always to fill a given bucket.
The first test is for buckets of size 3 and 5, target liquid 1, starting with the first bucket. The number of steps in the answer is 4.
The second test is for buckets of size 3 and 5, target liquid 1 (same as first test), starting with the second bucket (change from first test). The number of steps in the answer is 8.
However for the second case/test…
Surely you can fill bucket 2 (step 1), then empty bucket 2 (step 2) and act as if the first bucket was the starting one . If answer to that is 4, now we can solve it in 6 steps, not 8.
The same goes for test 3 and 4. In the general sense, if the other bucket yields n steps, you’re guaranteed a n+2 solution.