| ||There are two types of egg cartons. One type contains 6 eggs and the other type contains 8 eggs.
John wants to buy exactly n eggs. Return the minimal number of egg cartons he must buy. If it's impossible to buy exactly n eggs, return -1.|
|Method signature:||int minCartons(int n)|
|(be sure your method is public)|
|-||n will be between 1 and 100, inclusive.|
|He should buy 2 cartons containing 6 eggs and 1 carton containing 8 eggs. In total, he buys 3 egg cartons.|
|There are two ways to buy 24 eggs: buy 4 cartons containing 6 eggs or buy 3 cartons containing 8 eggs.
Minimize the number of cartons.|
|He can't buy an odd number of eggs.|