CTCI 9.11 count ways to get result of an exp