from [1 2 3 4 5] take 2 numbers, find all combinations:
go run combination.go
- [1 2]
- [1 3]
- [1 4]
- [1 5]
- [2 3]
- [2 4]
- [2 5]
- [3 4]
- [3 5]
- [4 5]
There is a 12L barrel full of gasoline, and there is a 9L barrel and a 5L barrel, how to divide the 12L gasoline into two parts?
go run split.go
- 12 0 0
- 3 9 0
- 3 4 5
- 7 0 5
- 7 5 0
- 2 5 5
- 2 9 1
- 11 0 1
- 11 1 0
- 6 1 5
- 6 6 0