Cut the eggs into 6 equal units (sixths). Broke = 1 unit, left = 12 = 3 units, so the 18 he gave away fill the other 2 units.

broke 1/6gave 18left 1/26 units = ? eggs

Plain numbers are given; italic underlined numbers are worked out.

  1. Gave away → 6 − 1 (broke) − 3 (left) = 2 units
  2. 2 units → 18 eggs
  3. 1 unit → 18 ÷ 2 = 9 eggs
  4. Total → 6 units = 6 × 9 = 54 eggs

He bought 54 eggs.

Check: broke 9 + gave 18 + left 27 = 54; 27 = 12 of 54. ✓