You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the two-bucket exercise, the Go-specific part of the instructions includes the following statement:
A solution cannot be found when input test case bucket sizes are not ones which allow the three operations to succeed in creating the goal amount, which occurs when the two bucket sizes are not relatively prime to one another.
This characterisation of unsolvable puzzles is incorrect - for example if sizeBucketOne == sizeBucketTwo == goalAmount == 3, there is the trivial one-(or two) step solution. The following characterisation is more precise (c.f Wikipedia: Water pouring puzzle):
A solution cannot be found when input test case bucket sizes are not ones which allow the three operations to succeed in creating the goal amount, which occurs when the goal amount is not a multiple of the greatest common divisor of the two bucket sizes.
We may also want to add a "bonus test case" that checks the more precise characterisation of solvable puzzles, for example:
In the two-bucket exercise, the Go-specific part of the instructions includes the following statement:
This characterisation of unsolvable puzzles is incorrect - for example if
sizeBucketOne == sizeBucketTwo == goalAmount == 3
, there is the trivial one-(or two) step solution. The following characterisation is more precise (c.f Wikipedia: Water pouring puzzle):We may also want to add a "bonus test case" that checks the more precise characterisation of solvable puzzles, for example:
The text was updated successfully, but these errors were encountered: