Assuming that the last monkey gets 0 peaches, the original question can be changed to: If each monkey gets 6 peaches, then there are 6 peaches missing. So we can calculate that the number of monkeys is (7+6)÷(6-4)=6.5. This assumption does not hold, because the number of monkeys must be an integer.
Suppose that the number of peaches shared by the last monkey is 1, then the original question can be changed to: If each monkey shares 6 peaches, then 5 peaches are missing. So we can calculate that the number of monkeys is (7+5)÷(6-4)=6. The total number of peaches is 4×6+7=3 1.