The classic building and bunch o' eggs dynamic programming problem solved in Java