Crack Coding Interview solutions in Java